2 // System.Drawing.FontConverter.cs
5 // Dennis Hayes (dennish@Raytek.com)
6 // Gonzalo Paniagua Javier (gonzalo@ximian.com)
7 // Ravindra (rkumar@novell.com)
9 // Copyright (C) 2002,2003 Ximian, Inc. http://www.ximian.com
10 // Copyright (C) 2004 Novell, Inc. http://www.novell.com
14 using System.Collections;
15 using System.ComponentModel;
16 using System.Globalization;
18 namespace System.Drawing
20 public class FontConverter : TypeConverter
22 public FontConverter ()
26 public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
28 if (sourceType == typeof (string))
31 return base.CanConvertFrom (context, sourceType);
34 public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
36 if (destinationType == typeof (String))
39 return base.CanConvertTo (context, destinationType);
42 public override object ConvertTo (ITypeDescriptorContext context,
47 if ((destinationType == typeof (string)) && (value is Font))
48 return value.ToString ();
50 return base.ConvertTo (context, culture, value, destinationType);
54 public override object ConvertFrom (ITypeDescriptorContext context,
58 throw new NotImplementedException ();
62 public override object CreateInstance (ITypeDescriptorContext context,
63 IDictionary propertyValues)
65 throw new NotImplementedException ();
68 public override bool GetCreateInstanceSupported (ITypeDescriptorContext context)
73 public override PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context,
75 Attribute [] attributes)
78 return TypeDescriptor.GetProperties (value, attributes);
80 return base.GetProperties (context, value, attributes);
83 public override bool GetPropertiesSupported (ITypeDescriptorContext context)
88 public sealed class FontNameConverter : TypeConverter
90 public FontNameConverter ()
94 public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
96 if (sourceType == typeof (string))
99 return base.CanConvertFrom (context, sourceType);
103 public override object ConvertFrom (ITypeDescriptorContext context,
107 throw new NotImplementedException ();
111 public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
113 throw new NotImplementedException ();
117 public override bool GetStandardValuesExclusive (ITypeDescriptorContext context)
119 throw new NotImplementedException ();
122 public override bool GetStandardValuesSupported (ITypeDescriptorContext context)
128 ~FontNameConverter ()
130 throw new NotImplementedException ();
134 public sealed class FontUnitConverter : EnumConverter
136 public FontUnitConverter () : base (typeof (GraphicsUnit))
141 public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
143 throw new NotImplementedException ();