Quellcode durchsuchen

2002-06-20 Gonzalo Paniagua Javier <[email protected]>

	* StringConverter.cs: stubbed out.
	* TypeConverter.cs: stubbed the rest out and added some implementation.

	Five errors left when compiling System.Web in linux.

svn path=/trunk/mcs/; revision=5375
Gonzalo Paniagua Javier vor 23 Jahren
Ursprung
Commit
1168140dd3

+ 7 - 0
mcs/class/System/System.ComponentModel/ChangeLog

@@ -1,3 +1,10 @@
+2002-06-20  Gonzalo Paniagua Javier <[email protected]>
+
+	* StringConverter.cs: stubbed out.
+	* TypeConverter.cs: stubbed the rest out and added some implementation.
+
+	Five errors left when compiling System.Web in linux.
+
 2002-06-20  Gonzalo Paniagua Javier <[email protected]>
 
 	* TypeConverterAttribute.cs: attribute used by 

+ 34 - 0
mcs/class/System/System.ComponentModel/StringConverter.cs

@@ -0,0 +1,34 @@
+//
+// System.ComponentModel.StringConverter
+//
+// Authors:
+//	Gonzalo Paniagua Javier ([email protected])
+//
+// (C) 2002 Ximian, Inc (http://www.ximian.com)
+//
+
+using System;
+using System.Globalization;
+
+namespace System.ComponentModel {
+
+public class StringConverter : TypeConverter
+{
+	public StringConverter ()
+	{
+	}
+
+	[MonoTODO]
+	public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
+	{
+		throw new NotImplementedException ();
+	}
+}
+}
+

+ 248 - 4
mcs/class/System/System.ComponentModel/TypeConverter.cs

@@ -8,6 +8,7 @@
 //
 
 using System;
+using System.Collections;
 using System.Globalization;
 
 namespace System.ComponentModel {
@@ -15,14 +16,50 @@ namespace System.ComponentModel {
 [MonoTODO("Only has the minimal implementation needed to use ColorConverter")]
 public class TypeConverter
 {
+	public TypeConverter ()
+	{
+	}
+
+	public bool CanConvertFrom (Type sourceType)
+	{
+		return CanConvertFrom (null, sourceType);
+	}
+	
+	[MonoTODO]
+	public virtual bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
+	{
+		throw new NotImplementedException ();
+	}
+
+	public bool CanConvertTo (Type destinationType)
+	{
+		return CanConvertTo (null, destinationType);
+	}
+	
+	[MonoTODO]
+	public virtual bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
+	{
+		throw new NotImplementedException ();
+	}
+
 	public object ConvertFrom (object o)
 	{
-		return ConvertFrom (null, null, o);
+		return ConvertFrom (null, CultureInfo.CurrentCulture, o);
+	}
+
+	[MonoTODO]
+	public virtual object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
+	{
+		throw new NotImplementedException ();
+	}
+	
+	public virtual object ConvertFromInvariantString (string text)
+	{
+		return ConvertFromInvariantString (null, text); 
 	}
 
-	public virtual object ConvertFrom (ITypeDescriptorContext context,
-					   CultureInfo culture,
-					   object value)
+	[MonoTODO]
+	public virtual object ConvertFromInvariantString (ITypeDescriptorContext context, string text)
 	{
 		throw new NotImplementedException ();
 	}
@@ -31,6 +68,213 @@ public class TypeConverter
 	{
 		return ConvertFrom (s);
 	}
+
+	public object ConvertFromString (ITypeDescriptorContext context, string text)
+	{
+		return ConvertFromString (context, CultureInfo.CurrentCulture, text);
+	}
+
+	[MonoTODO]
+	public object ConvertFromString (ITypeDescriptorContext context, CultureInfo culture, string text)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public object ConvertTo (object value, Type destinationType)
+	{
+		throw new NotImplementedException ();
+	}
+	[MonoTODO]
+	public virtual object ConvertTo (ITypeDescriptorContext context,
+					 CultureInfo culture,
+					 object value,
+					 Type destinationType)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public string ConvertToInvariantString (object value)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public string ConvertToInvariantString (ITypeDescriptorContext context, object value)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public string ConvertToString (object value)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public string ConvertToString (ITypeDescriptorContext context, object value)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public string ConvertToString (ITypeDescriptorContext context, CultureInfo culture, object value)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public object CreateInstance (IDictionary propertyValues)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public virtual object CreateInstance (ITypeDescriptorContext context, IDictionary propertyValues)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public bool GetCreateInstanceSupported ()
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public virtual bool GetCreateInstanceSupported (ITypeDescriptorContext context)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public PropertyDescriptorCollection GetProperties (object value)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context, object value)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public virtual PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context,
+								   object value,
+								   Attribute[] attributes)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public bool GetPropertiesSupported ()
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public virtual bool GetPropertiesSupported (ITypeDescriptorContext context)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public ICollection GetStandardValues ()
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public virtual StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public bool GetStandardValuesExclusive ()
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public virtual bool GetStandardValuesExclusive (ITypeDescriptorContext context)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public bool GetStandardValuesSupported ()
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public virtual bool GetStandardValuesSupported (ITypeDescriptorContext context)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public bool IsValid (object value)
+	{
+		throw new NotImplementedException ();
+	}
+
+	[MonoTODO]
+	public virtual bool IsValid (ITypeDescriptorContext context, object value)
+	{
+		throw new NotImplementedException ();
+	}
+
+	//public class StandardValuesCollection : ICollection, IEnumerable
+	public class StandardValuesCollection : IEnumerable
+	{
+		private ICollection values;
+		
+		public StandardValuesCollection (ICollection values)
+		{
+			this.values = values;
+		}
+
+		public void CopyTo (Array array, int index)
+		{
+			values.CopyTo (array, index);
+		}
+
+		public IEnumerator GetEnumerator ()
+		{
+			return values.GetEnumerator ();
+		}
+
+		/*
+		bool ICollection.IsSynchronized ()
+		{
+			return false;
+		}
+
+		bool ICollection.SyncRoot ()
+		{
+			return false;
+		}
+
+		bool ICollection.Count
+		{
+			get { return this.Count; }
+		}
+		*/
+
+		public int Count
+		{
+			get { return values.Count; }
+		}
+
+		public object this [int index]
+		{
+			get { return ((IList) values) [index]; }
+		}
+	}
 }
 }