Unosquare
    Show / Hide Table of Contents

    Class ConfiguredObject

    Base class for objects whose configuration may be locked, thus becoming read-only, at a certain moment in their lifetime.

    Inheritance
    Object
    ConfiguredObject
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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
    EnsureConfigurationNotLocked()

    Methods

    EnsureConfigurationNotLocked()

    Checks whether a module's configuration has become read-only and, if so, throws an .

    Declaration
    protected void EnsureConfigurationNotLocked()
    See Also
    ConfigurationLocked

    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()

    OnBeforeLockConfiguration()

    Called immediately before locking the configuration.

    Declaration
    protected virtual void OnBeforeLockConfiguration()
    See Also
    LockConfiguration()

    Comments

    Back to top Copyright © 2017-2019 Unosquare