Merge pull request #364 from directhex/master
[mono.git] / mcs / class / System.Configuration / System.Configuration / ConfigurationPropertyAttribute.cs
index 2460eab34cef0c2d931212706ef46a2644737dd2..1b816f9b919304ca6e15794d6ecd7e5b43f339e2 100644 (file)
 
 namespace System.Configuration
 {
+       [AttributeUsage (AttributeTargets.Property)]
        public sealed class ConfigurationPropertyAttribute : Attribute
        {
                string name;
-               object default_value;
-               ConfigurationPropertyFlags flags;
+               object default_value = ConfigurationProperty.NoDefaultValue;
+               ConfigurationPropertyOptions flags;
                
                public ConfigurationPropertyAttribute (string name)
                {
                        this.name = name;
                }
                
-               public bool CollectionKey {
-                       get { return (flags & ConfigurationPropertyFlags.IsKey) != 0; }
+               public bool IsKey {
+                       get { return (flags & ConfigurationPropertyOptions.IsKey) != 0; }
                        set {
-                               if (value) flags |= ConfigurationPropertyFlags.IsKey; 
-                               else flags &= ~ConfigurationPropertyFlags.IsKey; 
+                               if (value) flags |= ConfigurationPropertyOptions.IsKey; 
+                               else flags &= ~ConfigurationPropertyOptions.IsKey; 
                        }
                }
                
-               public bool DefaultCollectionProperty {
-                       get { return (flags & ConfigurationPropertyFlags.DefaultCollection) != 0; }
+               public bool IsDefaultCollection {
+                       get { return (flags & ConfigurationPropertyOptions.IsDefaultCollection) != 0; }
                        set {
-                               if (value) flags |= ConfigurationPropertyFlags.DefaultCollection; 
-                               else flags &= ~ConfigurationPropertyFlags.DefaultCollection; 
+                               if (value) flags |= ConfigurationPropertyOptions.IsDefaultCollection; 
+                               else flags &= ~ConfigurationPropertyOptions.IsDefaultCollection; 
                        }
                }
                
@@ -63,21 +64,20 @@ namespace System.Configuration
                        set { default_value = value; }
                }
                
-               public ConfigurationPropertyFlags Flags {
+               public ConfigurationPropertyOptions Options {
                        get { return flags; }
                        set { flags = value; }
                }
                
                public string Name {
                        get { return name; }
-                       set { name = value; }
                }
                
-               public bool RequiredValue {
-                       get { return (flags & ConfigurationPropertyFlags.Required) != 0; }
+               public bool IsRequired {
+                       get { return (flags & ConfigurationPropertyOptions.IsRequired) != 0; }
                        set {
-                               if (value) flags |= ConfigurationPropertyFlags.Required; 
-                               else flags &= ~ConfigurationPropertyFlags.Required; 
+                               if (value) flags |= ConfigurationPropertyOptions.IsRequired; 
+                               else flags &= ~ConfigurationPropertyOptions.IsRequired; 
                        }
                }
        }