Scope

Ecng.Common

Provides a scope for managing a resource with automatic disposal.

継承元: Disposable

コンストラクター

Scope
public Scope()
scope = Scope()

Initializes a new instance of the Scope class with a new instance of T.

Scope
public Scope(T value)
scope = Scope(value)

Initializes a new instance of the Scope class with the specified value.

value
The instance of T to be managed.
Scope
public Scope(T value, bool ownInstance)
scope = Scope(value, ownInstance)

Initializes a new instance of the Scope class with the specified value and ownership.

value
The instance of T to be managed.
ownInstance
Indicates whether the scope owns the instance and is responsible for disposing it.

プロパティ

All
public static ICollection<Scope<T>> All { get; }
value = Scope.All

Gets all scopes in the current hierarchy as a collection.

Current
public static Scope<T> Current { get; }
value = Scope.Current

Gets the current scope.

IsDefined
public static bool IsDefined { get; }
value = Scope.IsDefined

Gets a value indicating whether a current scope is defined.

OwnInstance
public bool OwnInstance { get; }
value = scope.OwnInstance

Gets a value indicating whether the scope owns the managed instance.

Parent
public Scope<T> Parent { get; }
value = scope.Parent

Gets the parent scope of the current scope.

Value
public T Value { get; }
value = scope.Value

Gets the value contained in the scope.

メソッド

DisposeManaged
protected override void DisposeManaged()
scope.DisposeManaged()

Disposes the managed resources used by the Scope class.