<PackageReference Include="Nito.Disposables" Version="2.5.0-alpha.1" />

Nito.Disposables.Internals.IReferenceCounter

public interface IReferenceCounter
A reference count for an underlying target.

Decrements the reference count and returns null. If this call causes the reference count to reach zero, returns the underlying target.

object TryGetTarget()

Returns the underlying target. Returns null if the reference count has already reached zero.

Increments the reference count and returns true. If the reference count has already reached zero, returns false.