Forráskód Böngészése

2002-08-23 Gonzalo Paniagua Javier <[email protected]>

	* System.ComponentModel/BindableSupport.cs:
	* System.ComponentModel/Component.cs:
	* System.ComponentModel/EventDescriptorCollection.cs:
	* System.ComponentModel/ITypeDescriptorContext.cs:
	* System.ComponentModel/TypeConverter.cs:
	* System.ComponentModel/TypeDescriptor.cs:
	* System.Diagnostics/Process.cs: more class status based fixes.

	* System.ComponentModel/StringConverter.cs: implemented a couple of
	methods.

svn path=/trunk/mcs/; revision=6929
Gonzalo Paniagua Javier 23 éve
szülő
commit
f08d92fb2c

+ 2 - 2
mcs/class/System/System.ComponentModel/BindableSupport.cs

@@ -11,8 +11,8 @@ namespace System.ComponentModel
 {
 	[Serializable]
 	public enum BindableSupport {
-		Default,
 		No,
-		Yes
+		Yes,
+		Default
 	}
 }

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

@@ -1,3 +1,14 @@
+2002-08-23  Gonzalo Paniagua Javier <[email protected]>
+
+	* BindableSupport.cs:
+	* Component.cs:
+	* EventDescriptorCollection.cs:
+	* ITypeDescriptorContext.cs:
+	* TypeConverter.cs:
+	* TypeDescriptor.cs: class status based fixes.
+	
+	* StringConverter.cs: implemented a couple of methods.
+
 2002-07-29  Gonzalo Paniagua Javier <[email protected]>
 
 	* EnumConverter.cs: new file.

+ 7 - 1
mcs/class/System/System.ComponentModel/Component.cs

@@ -83,7 +83,7 @@ namespace System.ComponentModel {
 		//   Dispose resources used by this component
 		// </summary>
 		[MonoTODO]
-		public virtual void Dispose ()
+		public void Dispose ()
 		{
 			// FIXME: Not sure this is correct.
 			Dispose(false);
@@ -116,6 +116,12 @@ namespace System.ComponentModel {
 			return null;
 		}
 
+		public override string ToString ()
+		{
+			if (mySite == null)
+				return GetType ().ToString ();
+			return String.Format ("{0} [{1}]", mySite.Name, GetType ().ToString ());
+		}
 		// <summary>
 		//   FIXME: Figure out this one.
 	        // </summary>

+ 2 - 2
mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs

@@ -81,12 +81,12 @@ namespace System.ComponentModel
 		}
 
 		[MonoTODO]
-		public virtual EventDescriptorCollection InternalSort (IComparer comparer) {
+		protected virtual EventDescriptorCollection InternalSort (IComparer comparer) {
 			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
-		public virtual EventDescriptorCollection InternalSort (string[] order) {
+		protected virtual EventDescriptorCollection InternalSort (string[] order) {
 			throw new NotImplementedException ();
 		}
 		

+ 1 - 1
mcs/class/System/System.ComponentModel/ITypeDescriptorContext.cs

@@ -22,7 +22,7 @@ public interface ITypeDescriptorContext : IServiceProvider
 
 	void OnComponentChanged ();
 
-	void OnComponentChanging ();
+	bool OnComponentChanging ();
 }
 
 }

+ 11 - 4
mcs/class/System/System.ComponentModel/StringConverter.cs

@@ -18,16 +18,23 @@ public class StringConverter : TypeConverter
 	{
 	}
 
-	[MonoTODO]
 	public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
 	{
-		throw new NotImplementedException ();
+		if (sourceType == typeof(String))
+			return true;
+
+		return base.CanConvertFrom (context, sourceType);
 	}
 
-	[MonoTODO]
 	public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
 	{
-		throw new NotImplementedException ();
+		if (value == null)
+			return String.Empty;
+
+		if (value is string)
+			return (string) value;
+
+		return base.ConvertFrom (context, culture, value);
 	}
 }
 }

+ 2 - 2
mcs/class/System/System.ComponentModel/TypeConverter.cs

@@ -51,13 +51,13 @@ public class TypeConverter
 		throw new NotImplementedException ();
 	}
 	
-	public virtual object ConvertFromInvariantString (string text)
+	public object ConvertFromInvariantString (string text)
 	{
 		return ConvertFromInvariantString (null, text); 
 	}
 
 	[MonoTODO]
-	public virtual object ConvertFromInvariantString (ITypeDescriptorContext context, string text)
+	public object ConvertFromInvariantString (ITypeDescriptorContext context, string text)
 	{
 		throw new NotImplementedException ();
 	}

+ 4 - 0
mcs/class/System/System.ComponentModel/TypeDescriptor.cs

@@ -19,6 +19,10 @@ public sealed class TypeDescriptor
 	private static readonly string creatingDefaultConverters = "creatingDefaultConverters";
 	private static Hashtable defaultConverters;
 
+	private TypeDescriptor ()
+	{
+	}
+
 	[MonoTODO]
 	public static void AddEditorTable (Type editorBaseType, Hashtable table)
 	{

+ 4 - 0
mcs/class/System/System.Diagnostics/ChangeLog

@@ -1,3 +1,7 @@
+2002-08-23  Gonzalo Paniagua Javier <[email protected]>
+
+	* Process.cs: class status based fixes.
+
 2002-07-20  Dick Porter  <[email protected]>
 
 	* Process.cs: Implement file handle redirection

+ 1 - 1
mcs/class/System/System.Diagnostics/Process.cs

@@ -587,7 +587,7 @@ namespace System.Diagnostics {
 			}
 		}
 
-		public override void Dispose() {
+		public void Dispose() {
 			Dispose(true);
 			// Take yourself off the Finalization queue
 			GC.SuppressFinalize(this);