What is the difference between using a PropertyDescriptor that returns a value for the IsReadOnly() method, and one that is associated with a ReadOnlyAttribute?
What is the difference between using a PropertyDescriptor that returns a value for the
Share
The main difference is that this allows you to seize more control if you provide your own
PropertyDescriptorimplementation (viaICustomTypeDescriptor,TypeDescriptionProviderorTypeConverter). Then you can choose your own logic for when it is writeable – for example, based on access rights.But yes; under the default implementation, it will report read-only for properties without setters, and for properties marked with
ReadOnlyAttribute.