Click or drag to resize

ImmutableObjectBaseT Class

Represents an object that can be configured as read only and thus made immutable. The origional contents of this class will not be editable once IsReadOnly is set to true. In order to modify the contest of this object, a clone of the object must be created with CloneEditable.
Inheritance Hierarchy

Namespace: GSF.Immutable
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public abstract class ImmutableObjectBase<T> : IImmutableObject<T>, 
	IImmutableObject, ICloneable
where T : ImmutableObjectBase<T>
View Source

Type Parameters

T

The ImmutableObjectBaseT type exposes the following members.

Constructors
 NameDescription
Protected methodImmutableObjectBaseTInitializes a new instance of the ImmutableObjectBaseT class
Top
Properties
 NameDescription
Public propertyIsReadOnly Gets/Sets if this class is immutable and thus read only. Once setting to readonly, the class becomes immutable.
Top
Methods
 NameDescription
Public methodClone Returns a clone of this class. If the class is marked as readonly, it returns the current instance.
Public methodCloneEditable Creates a clone of this class that is editable. A clone is always created, even if this class is already editable.
Protected methodCloneMembersAsEditable Request that member fields be cloned and marked as editable.
Public methodCloneReadonly Makes a readonly clone of the object. If the class is currently marked as readonly, the current instance is returned.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Protected methodSetMembersAsReadOnly Requests that member fields be set to readonly.
Protected methodTestForEditable Test if the class has been marked as readonly. Throws an exception if editing cannot occur.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
For a classes that implement this, all setters should call TestForEditable before setting the value.
See Also