2007-10-27 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / class / corlib / System / AttributeUsageAttribute.cs
index c0bcb0616a28b3fa70950a3da2a4859b60be42e8..3e30e6a5fcba9744fae808ef412db26060233323 100644 (file)
@@ -1,50 +1,77 @@
-//\r
-// System.AttributeUsage.cs\r
-//\r
-// Author:\r
-//   Miguel de Icaza (miguel@ximian.com)\r
-//\r
-// (C) Ximian, Inc.  http://www.ximian.com\r
-//\r
-\r
-namespace System {\r
-\r
-       [AttributeUsage(AttributeTargets.All)]\r
-       [Serializable]\r
-       public sealed class AttributeUsageAttribute : Attribute {\r
-               AttributeTargets valid_on;\r
-               bool allow_multiple, inherited;\r
-               \r
-               public AttributeUsageAttribute (AttributeTargets validOn)\r
-               {\r
-                       valid_on = validOn;\r
-               }\r
-\r
-               public bool AllowMultiple {\r
-                       get {\r
-                               return allow_multiple;\r
-                       }\r
-\r
-                       set {\r
-                               allow_multiple = value;\r
-                       }\r
-               }\r
-\r
-               public bool Inherited {\r
-                       get {\r
-                               return inherited;\r
-                       }\r
-\r
-                       set {\r
-                               inherited = value;\r
-                       }\r
-               }\r
-\r
-               public AttributeTargets ValidOn {\r
-                       get {\r
-                               return valid_on;\r
-                       }\r
-               }\r
-       }\r
-}\r
-\r
+//
+// System.AttributeUsageAttribute.cs
+//
+// Author:
+//   Miguel de Icaza (miguel@ximian.com)
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System.Runtime.InteropServices;
+
+namespace System
+{
+       [Serializable, AttributeUsage (AttributeTargets.Class)]
+#if NET_2_0
+       [ComVisible (true)]
+#endif
+       public sealed class AttributeUsageAttribute : Attribute
+       {
+               AttributeTargets valid_on;
+               bool allow_multiple;
+               bool inherited = true;
+
+               public AttributeUsageAttribute (AttributeTargets validOn)
+               {
+                       valid_on = validOn;
+               }
+
+               public bool AllowMultiple {
+                       get {
+                               return allow_multiple;
+                       }
+                       set {
+                               allow_multiple = value;
+                       }
+               }
+
+               public bool Inherited {
+                       get {
+                               return inherited;
+                       }
+                       set {
+                               inherited = value;
+                       }
+               }
+
+               public AttributeTargets ValidOn {
+                       get {
+                               return valid_on;
+                       }
+               }
+       }
+}
+
+