Explorar o código

* UITypeEditor.cs: Add a table of special editors (types that can't use
attributes to specify the editor) to TypeDescriptor.

svn path=/trunk/mcs/; revision=81708

Rolf Bjarne Kvinge %!s(int64=18) %!d(string=hai) anos
pai
achega
df41e8a04a

+ 5 - 0
mcs/class/System.Drawing/System.Drawing.Design/ChangeLog

@@ -1,3 +1,8 @@
+2007-07-10  Rolf Bjarne Kvinge <[email protected]> 
+
+	* UITypeEditor.cs: Add a table of special editors (types that can't use
+	  attributes to specify the editor) to TypeDescriptor.
+
 2007-06-30  Gert Driesen  <[email protected]>
 
 	* ToolboxItem.cs: GetType (IDesignerHost) is 2.0 only.

+ 12 - 0
mcs/class/System.Drawing/System.Drawing.Design/UITypeEditor.cs

@@ -31,6 +31,7 @@
 
 using System.ComponentModel;
 using System.Security.Permissions;
+using System.Collections;
 
 namespace System.Drawing.Design
 {
@@ -38,6 +39,17 @@ namespace System.Drawing.Design
 	[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
 	public class UITypeEditor {
 
+		static UITypeEditor ()
+		{
+			Hashtable editors = new Hashtable ();
+			editors [typeof (Array)] = "System.ComponentModel.Design.ArrayEditor, " + Consts.AssemblySystem_Design;
+			editors [typeof (byte [])] = "System.ComponentModel.Design.BinaryEditor, " + Consts.AssemblySystem_Design;
+			editors [typeof (DateTime)] = "System.ComponentModel.Design.DateTimeEditor, " + Consts.AssemblySystem_Design;
+			editors [typeof (IList)] = "System.ComponentModel.Design.CollectionEditor, " + Consts.AssemblySystem_Design;
+			editors [typeof (ICollection)] = "System.ComponentModel.Design.CollectionEditor, " + Consts.AssemblySystem_Design;
+			TypeDescriptor.AddEditorTable (typeof (UITypeEditor), editors);
+		}
+		
 		public UITypeEditor()
 		{
 		}