DekGenius.com
[ Team LiB ] Previous Section Next Section

ReadOnlyAttribute

System.ComponentModel (system.dll)sealed class

If you mark a property with this attribute, you can indicate whether it is read-only or read- write in the designer. Compare this with the DesignOnlyAttribute.

You can use the IsReadOnly property to determine the state of the attribute, but an instance of the attribute can also be compared against the Yes and No values for equality.

public sealed class ReadOnlyAttribute : Attribute {
// Public Constructors
   public ReadOnlyAttribute(bool isReadOnly);
// Public Static Fields
   public static readonly ReadOnlyAttribute Default;  // =System.ComponentModel.ReadOnlyAttribute
   public static readonly ReadOnlyAttribute No;  // =System.ComponentModel.ReadOnlyAttribute
   public static readonly ReadOnlyAttribute Yes;  // =System.ComponentModel.ReadOnlyAttribute
// Public Instance Properties
   public bool IsReadOnly{get; }
// Public Instance Methods
   public override bool Equals(object value);  // overrides Attribute
   public override int GetHashCode();  // overrides Attribute
   public override bool IsDefaultAttribute();  // overrides Attribute
}

Hierarchy

System.Object System.Attribute ReadOnlyAttribute

Valid On

All

    [ Team LiB ] Previous Section Next Section