Cogs.Disposal
1.6.0
dotnet add package Cogs.Disposal --version 1.6.0
NuGet\Install-Package Cogs.Disposal -Version 1.6.0
<PackageReference Include="Cogs.Disposal" Version="1.6.0" />
paket add Cogs.Disposal --version 1.6.0
#r "nuget: Cogs.Disposal, 1.6.0"
// Install Cogs.Disposal as a Cake Addin #addin nuget:?package=Cogs.Disposal&version=1.6.0 // Install Cogs.Disposal as a Cake Tool #tool nuget:?package=Cogs.Disposal&version=1.6.0
Much like the Components library, this library features base classes that handle things we've written a thousand times over, this time involving disposal.
If you want to go with an implementation of the tried and true IDisposable
, just inherit from SyncDisposable
.
Want a taste of the new IAsyncDisposable
? Then, inherit from AsyncDisposable
.
Or, if you want to support both, there's Disposable
.
Additionally, if your object needs to be dynamic, you can use DynamicSyncDisposable
, DynamicAsyncDisposable
, or DynamicDisposable
.
Each of these features abstract methods to actually do your disposal.
But all of the base classes feature:
- proper implementation of the finalizer and use of
GC.SuppressFinalize
- monitored access to disposal to ensure it can't happen twice
- the ability to override or "cancel" disposal by returning false from the abstract methods (e.g. you're reference counting and only want to dispose when your counter reaches zero)
- a protected
ThrowIfDisposed
method you can call to before doing anything that requires you haven't been disposed - an
IsDisposed
property the value (and change notifications) of which are handled for you
This library provides the IDisposalStatus
interface, which defines the IsDisposed
property and all the base classes implement it.
This library also provides the INotifyDisposing
, INotifyDisposed
, and INotifyDisposalOverridden
interfaces, which add events that notify of these occurrences.
Lastly, this library provides DisposableValuesCache
and AsyncDisposableValuesCache
, which each represents a cache of key-value pairs which, once disposed by all retrievers, are removed.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Cogs.Components (>= 1.2.0)
- Nito.AsyncEx (>= 5.1.2)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Cogs.Disposal:
Package | Downloads |
---|---|
Cogs.ActiveExpressions
Cogs for active expressions. |
|
Cogs.ActiveQuery
Cogs for active queries. |
|
Cogs.Wpf
Cogs for WPF. Includes general-use behaviors, controls, validation rules, and value converters. Also includes ways to leverage Windows features beyond what WPF supports out of the box (such as using enabling blur-behind and binding system commands to controls) and the inclusion of input gestures in styles. |
|
Cogs.Windows
Cogs for Windows. Includes ways to get the Windows theme and create LNK short-cuts. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.6.0 | 1,683 | 1/26/2023 |
1.5.1 | 3,532 | 5/9/2022 |
1.5.0 | 872 | 5/8/2022 |
1.4.9 | 881 | 4/16/2022 |
1.4.8 | 875 | 4/16/2022 |
1.4.7 | 862 | 4/16/2022 |
1.4.6 | 870 | 4/15/2022 |
1.4.5 | 1,569 | 4/11/2022 |
1.4.4 | 851 | 4/11/2022 |
1.4.2 | 846 | 4/11/2022 |
1.4.1 | 902 | 4/6/2022 |
1.4.0 | 851 | 4/6/2022 |
1.3.2 | 6,315 | 12/16/2021 |
1.3.1 | 1,591 | 11/2/2021 |
1.2.0 | 1,362 | 3/3/2021 |
1.1.6 | 1,976 | 2/20/2021 |
1.1.5 | 1,908 | 2/1/2021 |
1.1.4 | 1,327 | 1/30/2021 |
1.1.3 | 1,442 | 11/22/2020 |
1.1.2 | 9,187 | 4/17/2020 |
1.1.1 | 2,138 | 3/1/2020 |
1.1.0 | 1,078 | 2/29/2020 |
1.0.0 | 971 | 10/11/2019 |
Non-abstract classes sealed for performance.