System.Reflection.PropertyInfo.CanWrite Property

Gets a value indicating whether the property can be written to.

Syntax

public abstract bool CanWrite { get; }

Value

true if the property reflected by the current instance has a Set accessor; otherwise, false .

Remarks

If the property does not have a set accessor, it cannot be written to.

To get the CanWrite property, first get the class Type. From the Type, get the PropertyInfo. From the PropertyInfo, get the CanWrite value.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0