Specifies whether the property this attribute is bound to is read-only or read/write. This class cannot be inherited
See Also: ReadOnlyAttribute
public sealed class ReadOnlyAttribute : Attribute
Members that are marked with the ReadOnlyAttribute set to true or that do not have a Set method cannot be changed. Members that do not have this attribute or that are marked with the ReadOnlyAttribute set to false are read/write, and they can be changed. The default is ReadOnlyAttribute.No.
The PropertyDescriptor class enforces the ReadOnlyAttribute in the design environment and at run time. When you mark a property with the ReadOnlyAttribute set to true, the value of this attribute is set to the constant member ReadOnlyAttribute.Yes. For a property marked with the ReadOnlyAttribute set to false, the value is ReadOnlyAttribute.No. Therefore, when you want to check the value of this attribute in your code, you must specify the attribute as ReadOnlyAttribute.Yes or ReadOnlyAttribute.No.
For more information, see Extending Metadata Using Attributes.
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 126.96.36.199, 188.8.131.52
The members of System.ComponentModel.ReadOnlyAttribute are listed below.
See Also: Attribute
Specifies that the property this attribute is bound to is read/write and can be modified. This static field is read-only.
Specifies that the property this attribute is bound to is read-only and cannot be modified in the server explorer. This static field is read-only.