Class SingletonBase<T>
Represents a singleton pattern abstract class.
Namespace: Swan
Syntax
public abstract class SingletonBase<T> : IDisposable where T : class
Type Parameters
Name | Description |
---|---|
T | The type of class. |
Fields
LazyInstance
The static, singleton instance reference.
Declaration
protected static readonly Lazy<T> LazyInstance
Field Value
Type | Description |
---|---|
Lazy<T> |
Properties
Instance
Gets the instance that this singleton represents. If the instance is null, it is constructed and assigned when this member is accessed.
Declaration
public static T Instance { get; }
Property Value
Type | Description |
---|---|
T | The instance. |
Methods
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources. Call the GC.SuppressFinalize if you override this method and use a non-default class finalizer (destructor).
Declaration
protected virtual void Dispose(bool disposeManaged)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposeManaged |
|