DataObjectAttribute.cs: Implemented
authorKonstantin Triger <kostat@mono-cvs.ximian.com>
Tue, 2 Jan 2007 14:07:24 +0000 (14:07 -0000)
committerKonstantin Triger <kostat@mono-cvs.ximian.com>
Tue, 2 Jan 2007 14:07:24 +0000 (14:07 -0000)
svn path=/trunk/mcs/; revision=70363

mcs/class/System/System.ComponentModel/ChangeLog
mcs/class/System/System.ComponentModel/DataObjectAttribute.cs [new file with mode: 0644]
mcs/class/System/System.dll.sources
mcs/class/System/System20.vmwcsproj

index b5bc95f48d5dd6e69f3aadebe6001603fd25113a..58df28e639eab4329691502eb364e924be6247a7 100644 (file)
@@ -1,3 +1,7 @@
+2007-01-02  Konstantin Triger  <kostat@mainsoft.com>
+
+       * DataObjectAttribute.cs: Implemented.
+
 2007-01-02  Konstantin Triger  <kostat@mainsoft.com>
 
        * EventHandlerList.cs: Do not reject null key.
diff --git a/mcs/class/System/System.ComponentModel/DataObjectAttribute.cs b/mcs/class/System/System.ComponentModel/DataObjectAttribute.cs
new file mode 100644 (file)
index 0000000..0d16488
--- /dev/null
@@ -0,0 +1,88 @@
+//\r
+// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+// Authors:\r
+//     Konstantin Triger <kostat@mainsoft.com>\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+//\r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+//\r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+\r
+#if NET_2_0\r
+\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Text;\r
+\r
+namespace System.ComponentModel\r
+{\r
+       [AttributeUsageAttribute (AttributeTargets.Class)]\r
+       public sealed class DataObjectAttribute : Attribute\r
+       {\r
+               #region Fields\r
+\r
+               public static readonly DataObjectAttribute DataObject;\r
+               public static readonly DataObjectAttribute Default;\r
+               public static readonly DataObjectAttribute NonDataObject;\r
+\r
+               readonly bool _isDataObject;\r
+\r
+               #endregion\r
+\r
+               #region Constructors\r
+\r
+               static DataObjectAttribute () {\r
+                       DataObject = new DataObjectAttribute (true);\r
+                       NonDataObject = new DataObjectAttribute (false);\r
+                       Default = NonDataObject;\r
+               }\r
+\r
+               public DataObjectAttribute () : this (true) { }\r
+               public DataObjectAttribute (bool isDataObject) {\r
+                       _isDataObject = isDataObject;\r
+               }\r
+\r
+               #endregion\r
+\r
+               #region Properties\r
+\r
+               public bool IsDataObject { get { return _isDataObject; } }\r
+\r
+               #endregion\r
+\r
+               #region Methods\r
+\r
+               public override bool Equals (object obj) {\r
+                       if (!(obj is DataObjectAttribute))\r
+                               return false;\r
+\r
+                       return ((DataObjectAttribute) obj).IsDataObject == IsDataObject;\r
+               }\r
+               public override int GetHashCode () {\r
+                       return IsDataObject.GetHashCode ();\r
+               }\r
+               public override bool IsDefaultAttribute () {\r
+                       return Default.Equals (this);\r
+               }\r
+\r
+               #endregion\r
+       }\r
+}\r
+\r
+#endif
\ No newline at end of file
index 384c84636459b92d1336dd317ea4670e8f3c5b98..fad826b32b62d8ed9852f633d2a226b11ddef51a 100644 (file)
@@ -188,6 +188,7 @@ System.ComponentModel/ComponentEditor.cs
 System.ComponentModel/ComponentResourceManager.cs
 System.ComponentModel/Container.cs
 System.ComponentModel/CultureInfoConverter.cs
+System.ComponentModel/DataObjectAttribute.cs
 System.ComponentModel/DataObjectMethodAttribute.cs
 System.ComponentModel/DataObjectMethodType.cs
 System.ComponentModel/DateTimeConverter.cs
index 002f173d8cf0f43e84dbb801edcc23b6cee8bff4..1aca94aaaf813e43f28a71e2b35ea52e0875a224 100644 (file)
     <Compile Include="System.ComponentModel\ComponentResourceManager.cs" />\r
     <Compile Include="System.ComponentModel\Container.cs" />\r
     <Compile Include="System.ComponentModel\CultureInfoConverter.cs" />\r
+    <Compile Include="System.ComponentModel\DataObjectAttribute.cs" />\r
     <Compile Include="System.ComponentModel\DataObjectMethodAttribute.cs" />\r
     <Compile Include="System.ComponentModel\DataObjectMethodType.cs" />\r
     <Compile Include="System.ComponentModel\DateTimeConverter.cs" />\r