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;
}
}
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;
}
}
}