Table of Contents

Struct DependencyImplementorDisposalStrategy

Namespace
LfrlAnvil.Dependencies
Assembly
LfrlAnvil.Dependencies.dll

Represents a descriptor of dependency implementor's automatic disposal strategy.

public readonly struct DependencyImplementorDisposalStrategy
Inherited Members

Properties

Callback

Specifies the optional disposal callback for UseCallbackType.

public Action<object>? Callback { get; }

Property Value

Action<object>

Type

Specifies the type of this disposal strategy.

public DependencyImplementorDisposalStrategyType Type { get; }

Property Value

DependencyImplementorDisposalStrategyType

Methods

RenounceOwnership()

Creates a new DependencyImplementorDisposalStrategy instance with RenounceOwnership. This strategy disables the automatic disposal.

[Pure]
public static DependencyImplementorDisposalStrategy RenounceOwnership()

Returns

DependencyImplementorDisposalStrategy

New DependencyImplementorDisposalStrategy instance.

ToString()

Returns a string representation of this DependencyImplementorDisposalStrategy instance.

[Pure]
public override string ToString()

Returns

string

String representation.

UseCallback(Action<object>)

Creates a new DependencyImplementorDisposalStrategy instance with UseCallback and custom callback.

[Pure]
public static DependencyImplementorDisposalStrategy UseCallback(Action<object> callback)

Parameters

callback Action<object>

Custom disposal callback.

Returns

DependencyImplementorDisposalStrategy

New DependencyImplementorDisposalStrategy instance.

UseDisposableInterface()

Creates a new DependencyImplementorDisposalStrategy instance with UseDisposableInterface type. This is the default automatic disposal strategy that invokes the Dispose() method if an object implements the IDisposable interface.

[Pure]
public static DependencyImplementorDisposalStrategy UseDisposableInterface()

Returns

DependencyImplementorDisposalStrategy

New DependencyImplementorDisposalStrategy instance.