CTX_Structure :: SetReadOnly - Set instance to read-only
The function allows protecting an instance from being updated or remove the write protection. The function can be called from within any structure context function or in relation with a structure context. The function will protect the current property handle and all subsequent handles, i.e. it works recursively. When resetting the read-only state the function will not reset subsequent property handles that have been set explicitly to read-only. Setting the read-only state for a property handle has the consequence that not only all subordinated instances are locked for writing but all subordinated collections as well, i.e. that the application cannot add or delete instances from subordinated property handles.
The read-only state is set for the property handle, i.e. after setting the read only state all instances selected for the property handle are read-only until the state is reset by another context function call.
The function returns the current state for the property handle.
When changing the instance state for a property handle this will affect the write permission only, when being set before selecting an instance in the Property handle. In order to activate the state for the instance currently selected the instance can be reselected (e.g. using PropertyHandle::Reset()). Resetting the read-only state will not affect instances that are write protected for other reasons and instances selected in other property handles, which have been set explicitly to "read only" by the application.
The read-only state may be true (YES) or false (NO). True (YES) indicates read-only state for the context, false (NO) indicated no read-only state.
Implementation details
- readonly
- Read-only state
The read-only state may be true (YES) or false (NO). True (YES) indicates read-only state for the context, false (NO) indicated no read-only state.