2 // System.ComponentModel.TypeConverter
5 // Gonzalo Paniagua Javier (gonzalo@ximian.com)
7 // (C) 2002 Ximian, Inc (http://www.ximian.com)
11 using System.Collections;
12 using System.Globalization;
14 namespace System.ComponentModel {
16 [MonoTODO("Only has the minimal implementation needed to use ColorConverter")]
17 public class TypeConverter
19 public TypeConverter ()
23 public bool CanConvertFrom (Type sourceType)
25 return CanConvertFrom (null, sourceType);
29 public virtual bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
31 throw new NotImplementedException ();
34 public bool CanConvertTo (Type destinationType)
36 return CanConvertTo (null, destinationType);
40 public virtual bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
42 throw new NotImplementedException ();
45 public object ConvertFrom (object o)
47 return ConvertFrom (null, CultureInfo.CurrentCulture, o);
51 public virtual object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
53 throw new NotImplementedException ();
56 public virtual object ConvertFromInvariantString (string text)
58 return ConvertFromInvariantString (null, text);
62 public virtual object ConvertFromInvariantString (ITypeDescriptorContext context, string text)
64 throw new NotImplementedException ();
67 public object ConvertFromString (string s)
69 return ConvertFrom (s);
72 public object ConvertFromString (ITypeDescriptorContext context, string text)
74 return ConvertFromString (context, CultureInfo.CurrentCulture, text);
78 public object ConvertFromString (ITypeDescriptorContext context, CultureInfo culture, string text)
80 throw new NotImplementedException ();
84 public object ConvertTo (object value, Type destinationType)
86 throw new NotImplementedException ();
89 public virtual object ConvertTo (ITypeDescriptorContext context,
94 throw new NotImplementedException ();
98 public string ConvertToInvariantString (object value)
100 throw new NotImplementedException ();
104 public string ConvertToInvariantString (ITypeDescriptorContext context, object value)
106 throw new NotImplementedException ();
110 public string ConvertToString (object value)
112 throw new NotImplementedException ();
116 public string ConvertToString (ITypeDescriptorContext context, object value)
118 throw new NotImplementedException ();
122 public string ConvertToString (ITypeDescriptorContext context, CultureInfo culture, object value)
124 throw new NotImplementedException ();
128 public object CreateInstance (IDictionary propertyValues)
130 throw new NotImplementedException ();
134 public virtual object CreateInstance (ITypeDescriptorContext context, IDictionary propertyValues)
136 throw new NotImplementedException ();
140 public bool GetCreateInstanceSupported ()
142 throw new NotImplementedException ();
146 public virtual bool GetCreateInstanceSupported (ITypeDescriptorContext context)
148 throw new NotImplementedException ();
152 public PropertyDescriptorCollection GetProperties (object value)
154 throw new NotImplementedException ();
158 public PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context, object value)
160 throw new NotImplementedException ();
164 public virtual PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context,
166 Attribute[] attributes)
168 throw new NotImplementedException ();
172 public bool GetPropertiesSupported ()
174 throw new NotImplementedException ();
178 public virtual bool GetPropertiesSupported (ITypeDescriptorContext context)
180 throw new NotImplementedException ();
184 public ICollection GetStandardValues ()
186 throw new NotImplementedException ();
190 public virtual StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
192 throw new NotImplementedException ();
196 public bool GetStandardValuesExclusive ()
198 throw new NotImplementedException ();
202 public virtual bool GetStandardValuesExclusive (ITypeDescriptorContext context)
204 throw new NotImplementedException ();
208 public bool GetStandardValuesSupported ()
210 throw new NotImplementedException ();
214 public virtual bool GetStandardValuesSupported (ITypeDescriptorContext context)
216 throw new NotImplementedException ();
220 public bool IsValid (object value)
222 throw new NotImplementedException ();
226 public virtual bool IsValid (ITypeDescriptorContext context, object value)
228 throw new NotImplementedException ();
231 //public class StandardValuesCollection : ICollection, IEnumerable
232 public class StandardValuesCollection : IEnumerable
234 private ICollection values;
236 public StandardValuesCollection (ICollection values)
238 this.values = values;
241 public void CopyTo (Array array, int index)
243 values.CopyTo (array, index);
246 public IEnumerator GetEnumerator ()
248 return values.GetEnumerator ();
252 bool ICollection.IsSynchronized ()
257 bool ICollection.SyncRoot ()
262 bool ICollection.Count
264 get { return this.Count; }
270 get { return values.Count; }
273 public object this [int index]
275 get { return ((IList) values) [index]; }