Class ConfiguredObject
Base class for objects whose configuration may be locked, thus becoming read-only, at a certain moment in their lifetime.
Inherited Members
Namespace: Swan.Configuration
Syntax
public abstract class ConfiguredObject
Properties
ConfigurationLocked
Gets a value indicating whether s configuration has already been locked and has therefore become read-only.
Declaration
protected bool ConfigurationLocked { get; }
Property Value
Type | Description |
---|---|
Boolean | true if the configuration is locked; otherwise, false. |
See Also
Methods
EnsureConfigurationNotLocked()
Checks whether a module's configuration has become read-only
and, if so, throws an
Declaration
protected void EnsureConfigurationNotLocked()
See Also
LockConfiguration()
Locks this instance's configuration, preventing further modifications.
Declaration
protected void LockConfiguration()
Remarks
Configuration locking must be enforced by derived classes by calling EnsureConfigurationNotLocked() at the start of methods and property setters that could change the object's configuration.
Immediately before locking the configuration, this method calls OnBeforeLockConfiguration() as a last chance to validate configuration data, and to lock the configuration of contained objects.
See Also
OnBeforeLockConfiguration()
Called immediately before locking the configuration.
Declaration
protected virtual void OnBeforeLockConfiguration()