Skip to content

Commit

Permalink
Add convenience members.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCleary committed Dec 14, 2021
1 parent 53a6f30 commit 7ee87db
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Nito.Disposables/IReferenceCountedAsyncDisposable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ public interface IReferenceCountedAsyncDisposable<out T> : IAsyncDisposable
/// Gets the target object. Throws <see cref="ObjectDisposedException"/> if this instance is disposed.
/// </summary>
T? Target { get; }

/// <summary>
/// Whether this instance is currently disposing or has been disposed.
/// </summary>
public bool IsDisposeStarted { get; }

/// <summary>
/// Whether this instance is disposed (finished disposing).
/// </summary>
public bool IsDisposed { get; }

/// <summary>
/// Whether this instance is currently disposing, but not finished yet.
/// </summary>
public bool IsDisposing { get; }
}
}
#endif
15 changes: 15 additions & 0 deletions src/Nito.Disposables/IReferenceCountedDisposable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,20 @@ public interface IReferenceCountedDisposable<out T> : IDisposable
/// Gets the target object. Throws <see cref="ObjectDisposedException"/> if this instance is disposed.
/// </summary>
T? Target { get; }

/// <summary>
/// Whether this instance is currently disposing or has been disposed.
/// </summary>
public bool IsDisposeStarted { get; }

/// <summary>
/// Whether this instance is disposed (finished disposing).
/// </summary>
public bool IsDisposed { get; }

/// <summary>
/// Whether this instance is currently disposing, but not finished yet.
/// </summary>
public bool IsDisposing { get; }
}
}

0 comments on commit 7ee87db

Please sign in to comment.