2 * Namespace: System.Web.UI.WebControls
\r
5 * Author: Gaurav Vaish
\r
6 * Maintainer: gvaish@iitk.ac.in
\r
7 * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
\r
10 * (C) Gaurav Vaish (2001)
\r
14 using System.Reflection;
\r
16 using System.Web.UI;
\r
17 using System.Drawing;
\r
19 namespace System.Web.UI.WebControls
\r
21 public sealed class FontInfo
\r
24 private bool italic;
\r
25 private bool overline;
\r
26 private bool strikeout;
\r
27 private bool underline;
\r
28 private string name; //TODO: This will have the value of names[0] by default
\r
29 private string[] names; //TODO: How do get the list of fonts available?
\r
30 private FontUnit size = FontUnit.Empty;
\r
39 name = string.Empty;
\r
66 public bool Overline
\r
78 public bool Strikeout
\r
90 public bool Underline
\r
114 public string[] Names
\r
127 //TODO: To throw exception if the index is negative
\r
128 public FontUnit Size
\r
140 public void CopyFrom(FontInfo from)
\r
142 //TODO: What a rubbish way to accomplish the task
\r
143 /*this.bold = from.Bold;
\r
144 this.italic = from.Italic;
\r
145 this.name = from.Name;
\r
146 this.names = from.Names;
\r
147 this.overline = from.Overline;
\r
148 this.size = from.Size;*/
\r
149 //TODO: Let me try Relflection
\r
150 Type t = from.GetType();
\r
151 MethodInfo[] fi = t.GetMethods();
\r
152 foreach(MethodInfo f in fi)
\r
154 //System.Console.WriteLine("Field: {0}", f.Name);
\r
155 if(f.Name.StartsWith("get_"))
\r
157 System.Console.WriteLine("\tStarts with get_");
\r
162 private void ListFields(FontInfo from)
\r
164 Type t = from.GetType();
\r
165 MethodInfo[] fi = t.GetMethods();
\r
166 foreach(MethodInfo f in fi)
\r
168 System.Console.WriteLine("Field: {0}", f.Name);
\r
169 if(f.Name.StartsWith("get_"))
\r
171 System.Console.WriteLine("\tStarts with get_");
\r
176 //TODO: after CopyFrom is implemented
\r
177 public void MergeWith(FontInfo with)
\r
181 public override string ToString()
\r
183 string retVal = this.name;
\r
184 if(this.size != FontUnit.Empty)
\r
186 this.name += ("," + this.size);
\r
192 protected object MemberwiseClone()
\r