Added new files from Martin Adoue <martin@cwanet.com>
authorMiguel de Icaza <miguel@gnome.org>
Wed, 8 May 2002 14:51:40 +0000 (14:51 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Wed, 8 May 2002 14:51:40 +0000 (14:51 -0000)
svn path=/trunk/mcs/; revision=4422

mcs/class/System/System.ComponentModel/DefaultValueAttribute.cs [new file with mode: 0755]
mcs/class/System/System.ComponentModel/EditorBrowsableAttribute.cs [new file with mode: 0755]
mcs/class/System/System.ComponentModel/EditorBrowsableState.cs [new file with mode: 0755]

diff --git a/mcs/class/System/System.ComponentModel/DefaultValueAttribute.cs b/mcs/class/System/System.ComponentModel/DefaultValueAttribute.cs
new file mode 100755 (executable)
index 0000000..43dfae2
--- /dev/null
@@ -0,0 +1,133 @@
+using System;\r
+\r
+namespace System.ComponentModel\r
+{\r
+       /// <summary>\r
+       /// Specifies the default value for a property.\r
+       /// </summary>\r
+\r
+       [MonoTODO("Needs testing. DefaultValueAttribute(System.Type type, string value) is not implemented. Value has no description.")]\r
+       [AttributeUsage(AttributeTargets.Parameter)]\r
+       public sealed class DefaultValueAttribute : Attribute\r
+       {\r
+\r
+               private object defaultValue;\r
+\r
+               /// <summary>\r
+               /// FIXME: Summary description for Value.\r
+               /// </summary>\r
+               public object Value\r
+               {\r
+                       get \r
+                       {\r
+                               return defaultValue;\r
+                       }\r
+               }\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class.\r
+               /// </summary>\r
+               /// <param name="value">An System.Object that represents the default value.</param>\r
+               public DefaultValueAttribute(object value)\r
+               {\r
+                       defaultValue = value;\r
+               }\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a System.Boolean value.\r
+               /// </summary>\r
+               /// <param name="value">An System.Boolean that represents the default value.</param>\r
+               public DefaultValueAttribute(bool value)\r
+               {\r
+                       defaultValue = value;\r
+               }\r
+\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using an 8-bit unsigned integer.\r
+               /// </summary>\r
+               /// <param name="value">An 8-bit unsigned integer that is the default value.</param>\r
+               public DefaultValueAttribute(byte value)\r
+               {\r
+                       defaultValue = value;\r
+               }\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a Unicode character.\r
+               /// </summary>\r
+               /// <param name="value">A Unicode character that is the default value.</param>\r
+               public DefaultValueAttribute(char value)\r
+               {\r
+                       defaultValue = value;\r
+               }\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a double-precision floating point number.\r
+               /// </summary>\r
+               /// <param name="value">A double-precision floating point number that is the default value.</param>\r
+               public DefaultValueAttribute(double value)\r
+               {\r
+                       defaultValue = value;\r
+               }\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a 32-bit signed integer.\r
+               /// </summary>\r
+               /// <param name="value">A 32-bit signed integer that is the default value.</param>\r
+               public DefaultValueAttribute(int value)\r
+               {\r
+                       defaultValue = value;\r
+               }\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a 64-bit signed integer.\r
+               /// </summary>\r
+               /// <param name="value">A 64-bit signed integer that is the default value.</param>\r
+               public DefaultValueAttribute(long value)\r
+               {\r
+                       defaultValue = value;\r
+               }\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a 16-bit signed integer.\r
+               /// </summary>\r
+               /// <param name="value">A 16-bit signed integer that is the default value.</param>\r
+               public DefaultValueAttribute(short value)\r
+               {\r
+                       defaultValue = value;\r
+               }\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a single-precision floating point number.\r
+               /// </summary>\r
+               /// <param name="value">A single-precision floating point number that is the default value.</param>\r
+               public DefaultValueAttribute(System.Single value)\r
+               {\r
+                       defaultValue = value;\r
+               }\r
+\r
+               /// <summary>   \r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a System.String.\r
+               /// </summary>\r
+               /// <param name="value">A System.String that is the default value.</param>\r
+               public DefaultValueAttribute(string value)\r
+               {\r
+                       defaultValue = value;\r
+               }\r
+\r
+               /*\r
+               /// <summary>   \r
+               /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class, converting the specified value to the specified type, and using an invariant culture as the translation context.\r
+               /// </summary>\r
+               /// <param name="type">A System.Type that represents the type to convert the value to.</param>\r
+               /// <param name="value">A System.String that can be converted to the type using the System.ComponentModel.TypeConverter for the type and the U.S. English culture.</param>\r
+               public DefaultValueAttribute(System.Type type, string value)\r
+               {\r
+                       //FIXME\r
+                       throw new NotImplementedException(); \r
+               }\r
+               */\r
+       }\r
+\r
+}\r
+\r
diff --git a/mcs/class/System/System.ComponentModel/EditorBrowsableAttribute.cs b/mcs/class/System/System.ComponentModel/EditorBrowsableAttribute.cs
new file mode 100755 (executable)
index 0000000..912cdb1
--- /dev/null
@@ -0,0 +1,53 @@
+using System;\r
+\r
+namespace System.ComponentModel\r
+{\r
+\r
+       /// <summary>\r
+       /// Specifies that a property or method is viewable in an editor. This class cannot be inherited.\r
+       /// </summary>\r
+       [MonoTODO("Missing description for State. Only minimal testing.")]\r
+       [AttributeUsage(\r
+               AttributeTargets.Class|\r
+               AttributeTargets.Constructor|\r
+               AttributeTargets.Delegate|\r
+               AttributeTargets.Enum|\r
+               AttributeTargets.Event|\r
+               AttributeTargets.Field|\r
+               AttributeTargets.Interface|\r
+               AttributeTargets.Method|\r
+               AttributeTargets.Property|\r
+               AttributeTargets.Struct)]\r
+       public sealed class EditorBrowsableAttribute : Attribute\r
+       {\r
+               private System.ComponentModel.EditorBrowsableState state;\r
+\r
+               /// <summary>\r
+               /// FIXME: Summary description for State.\r
+               /// </summary>\r
+               public System.ComponentModel.EditorBrowsableState State\r
+               {\r
+                       get \r
+                       {\r
+                               return state;\r
+                       }\r
+               }\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.EditorBrowsableAttribute class with an System.ComponentModel.EditorBrowsableState.\r
+               /// </summary>\r
+               /// <param name="state">The System.ComponentModel.EditorBrowsableState to set System.ComponentModel.EditorBrowsableAttribute.State to.</param>\r
+               public EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState state)\r
+               {\r
+                       this.state = state;\r
+               }\r
+\r
+               /// <summary>\r
+               /// Initializes a new instance of the System.ComponentModel.EditorBrowsableAttribute class with an System.ComponentModel.EditorBrowsableState == System.ComponentModel.EditorBrowsableState.Always.\r
+               /// </summary>\r
+               public EditorBrowsableAttribute()\r
+               {\r
+                       this.state = System.ComponentModel.EditorBrowsableState.Always; \r
+               }\r
+       }\r
+}\r
diff --git a/mcs/class/System/System.ComponentModel/EditorBrowsableState.cs b/mcs/class/System/System.ComponentModel/EditorBrowsableState.cs
new file mode 100755 (executable)
index 0000000..eab0d65
--- /dev/null
@@ -0,0 +1,34 @@
+//\r
+// ProjectData.cs\r
+//\r
+// Author:\r
+//   Martin Adoue (martin@cwanet.com)\r
+//\r
+// (C) 2002 Martin Adoue\r
+//\r
+\r
+using System;\r
+\r
+namespace System.ComponentModel\r
+{\r
+\r
+       /// <summary>\r
+       /// Specifies the browsable state of a property or method from within an editor.\r
+       /// </summary>\r
+       public enum EditorBrowsableState \r
+       {\r
+               /// <summary>\r
+               /// The property or method is always browsable from within an editor.\r
+               /// </summary>\r
+               Always = 0,\r
+               /// <summary>\r
+               /// The property or method is never browsable from within an editor.\r
+               /// </summary>\r
+               Never = 1,\r
+               /// <summary>\r
+               /// The property or method is a feature that only advanced users should see. An editor can either show or hide such properties.\r
+               /// </summary>\r
+               Advanced = 2\r
+       }\r
+\r
+}\r