DisposableHelpers 1.2.1
See the version list below for details.
dotnet add package DisposableHelpers --version 1.2.1
NuGet\Install-Package DisposableHelpers -Version 1.2.1
<PackageReference Include="DisposableHelpers" Version="1.2.1" />
<PackageVersion Include="DisposableHelpers" Version="1.2.1" />
<PackageReference Include="DisposableHelpers" />
paket add DisposableHelpers --version 1.2.1
#r "nuget: DisposableHelpers, 1.2.1"
#addin nuget:?package=DisposableHelpers&version=1.2.1
#tool nuget:?package=DisposableHelpers&version=1.2.1
DisposableHelpers
Disposable helpers for IDisposable and IAsyncDisposable with source generators. Also capable of both anonymous disposable and anonymous async disposable.
NuGets
Name | Info |
---|---|
DisposableHelpers |
Installation
// Install release version
Install-Package DisposableHelpers
// Install pre-release version
Install-Package DisposableHelpers -pre
Supported frameworks
.NET Standard 2.0 and above - see https://github.com/dotnet/standard/blob/master/docs/versions.md for compatibility matrix
Usage
Disposable
using DisposableHelpers;
namespace YourNamespace
{
public class SampleDisposable : Disposable
{
private SampleUnmanagedResource resources;
protected override void Dispose(bool disposing)
{
if (disposing)
{
resources.Release();
}
base.Dispose(disposing);
}
}
}
Disposable Source Generator
using DisposableHelpers.Attributes;
namespace YourNamespace
{
[Disposable]
public partial class SampleDisposable
{
private SampleUnmanagedResource resources;
protected void Dispose(bool disposing)
{
if (disposing)
{
resources.Release();
}
base.Dispose(disposing);
}
}
}
Anonymous Disposable
using DisposableHelpers;
namespace YourNamespace
{
public static class Program
{
private static SampleUnmanagedResource resources;
public static void Main(string[] args)
{
Disposable disposable = new Disposable(disposing =>
{
if (disposing)
{
resources.Release();
}
});
disposable.Dispose();
}
}
}
AsyncDisposable
using DisposableHelpers;
namespace YourNamespace
{
public class SampleAsyncDisposable : AsyncDisposable
{
private SampleAsyncUnmanagedResource resources;
protected override async ValueTask Dispose(bool isDisposing)
{
if (isDisposing)
{
await resources.Release();
}
return base.Dispose(isDisposing);
}
}
}
AsyncDisposable Source Generator
using DisposableHelpers.Attributes;
namespace YourNamespace
{
[AsyncDisposable]
public partial class SampleAsyncDisposable
{
private SampleAsyncUnmanagedResource resources;
protected async ValueTask Dispose(bool isDisposing)
{
if (isDisposing)
{
await resources.Release();
}
return base.Dispose(isDisposing);
}
}
}
Anonymous AsyncDisposable
using DisposableHelpers;
namespace YourNamespace
{
public static class Program
{
private static SampleAsyncUnmanagedResource resources;
public static async void Main(string[] args)
{
AsyncDisposable disposable = new AsyncDisposable(async disposing =>
{
if (disposing)
{
await resources.Release();
}
});
await disposable.DisposeAsync();
}
}
}
Want To Support This Project?
All I have ever asked is to be active by submitting bugs, features, and sending those pull requests down!.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. 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.0
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on DisposableHelpers:
Package | Downloads |
---|---|
SingletonSessionHelpers
Provides a base API for singleton session design pattern. |
|
LockerHelpers
Provides helpers for execution locking mechanism. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.2.102 | 200 | 4 days ago |
1.2.101 | 244 | 18 days ago |
1.2.99 | 159 | 19 days ago |
1.2.98 | 167 | a month ago |
1.2.97 | 180 | a month ago |
1.2.93 | 502 | 2 months ago |
1.2.92 | 170 | 2 months ago |
1.2.90 | 429 | 3 months ago |
1.2.89 | 236 | 3 months ago |
1.2.88 | 202 | 3 months ago |
1.2.86 | 372 | 3 months ago |
1.2.84 | 191 | 3 months ago |
1.2.83 | 323 | 3 months ago |
1.2.82 | 220 | 4 months ago |
1.2.81 | 208 | 4 months ago |
1.2.80 | 267 | 4 months ago |
1.2.79 | 233 | 4 months ago |
1.2.78 | 288 | 4 months ago |
1.2.77 | 305 | 4 months ago |
1.2.76 | 225 | 4 months ago |
1.2.75 | 193 | 4 months ago |
1.2.74 | 134 | 4 months ago |
1.2.73 | 213 | 4 months ago |
1.2.71 | 137 | 4 months ago |
1.2.70 | 252 | 5 months ago |
1.2.69 | 122 | 5 months ago |
1.2.68 | 125 | 5 months ago |
1.2.67 | 149 | 5 months ago |
1.2.64 | 323 | 5 months ago |
1.2.63 | 72 | 5 months ago |
1.2.62 | 246 | 5 months ago |
1.2.60 | 188 | 5 months ago |
1.2.59 | 220 | 5 months ago |
1.2.58 | 206 | 5 months ago |
1.2.57 | 73 | 5 months ago |
1.2.56 | 67 | 5 months ago |
1.2.55 | 65 | 5 months ago |
1.2.54 | 71 | 5 months ago |
1.2.53 | 199 | 5 months ago |
1.2.52 | 63 | 5 months ago |
1.2.51 | 194 | 5 months ago |
1.2.50 | 306 | 5 months ago |
1.2.49 | 166 | 5 months ago |
1.2.48 | 193 | 5 months ago |
1.2.47 | 275 | 6 months ago |
1.2.46 | 82 | 6 months ago |
1.2.45 | 347 | 6 months ago |
1.2.44 | 255 | 6 months ago |
1.2.43 | 340 | 6 months ago |
1.2.42 | 351 | 6 months ago |
1.2.41 | 288 | 6 months ago |
1.2.40 | 522 | 6 months ago |
1.2.39 | 296 | 6 months ago |
1.2.38 | 276 | 6 months ago |
1.2.37 | 280 | 7 months ago |
1.2.36 | 69 | 7 months ago |
1.2.35 | 82 | 7 months ago |
1.2.34 | 375 | 7 months ago |
1.2.33 | 169 | 7 months ago |
1.2.32 | 269 | 7 months ago |
1.2.31 | 74 | 7 months ago |
1.2.30 | 266 | 7 months ago |
1.2.29 | 144 | 7 months ago |
1.2.28 | 298 | 7 months ago |
1.2.27 | 180 | 7 months ago |
1.2.26 | 309 | 7 months ago |
1.2.24 | 379 | 7 months ago |
1.2.23 | 390 | 7 months ago |
1.2.22 | 285 | 8 months ago |
1.2.21 | 250 | 8 months ago |
1.2.20 | 77 | 8 months ago |
1.2.19 | 80 | 8 months ago |
1.2.18 | 187 | 8 months ago |
1.2.17 | 385 | 8 months ago |
1.2.16 | 173 | 8 months ago |
1.2.15 | 410 | 8 months ago |
1.2.14 | 92 | 8 months ago |
1.2.13 | 154 | 9 months ago |
1.2.12 | 501 | 9 months ago |
1.2.11 | 125 | 9 months ago |
1.2.10 | 115 | 9 months ago |
1.2.9 | 133 | 9 months ago |
1.2.8 | 155 | 9 months ago |
1.2.7 | 141 | 9 months ago |
1.2.6 | 77 | 9 months ago |
1.2.5 | 77 | 9 months ago |
1.2.4 | 165 | 9 months ago |
1.2.3 | 229 | 9 months ago |
1.2.2 | 122 | 9 months ago |
1.2.1 | 135 | 10 months ago |
1.2.0 | 211 | 5/3/2024 |
1.1.16 | 1,383 | 10/3/2023 |
1.1.15 | 320 | 8/30/2023 |
1.1.14 | 256 | 8/28/2023 |
1.1.13 | 283 | 8/8/2023 |
1.1.12 | 278 | 7/11/2023 |
1.1.11 | 167 | 7/9/2023 |
1.1.10 | 244 | 6/20/2023 |
1.1.9 | 1,766 | 9/8/2022 |
1.1.8 | 407 | 9/4/2022 |
1.1.7 | 420 | 9/4/2022 |
1.1.6 | 2,705 | 7/20/2022 |
1.1.5 | 442 | 7/20/2022 |
1.1.4 | 472 | 7/17/2022 |
1.1.3 | 418 | 7/17/2022 |
1.1.2 | 481 | 7/17/2022 |
1.1.1 | 441 | 7/17/2022 |
1.1.0 | 486 | 7/17/2022 |
1.0.2 | 4,159 | 3/7/2022 |
1.0.1 | 3,318 | 2/21/2022 |
1.0.0 | 1,223 | 2/17/2022 |
## What's Changed
* Bump xunit.runner.visualstudio from 2.5.1 to 2.5.3 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/13
* Bump xunit from 2.5.1 to 2.5.2 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/14
* Bump xunit from 2.5.2 to 2.5.3 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/15
* Bump xunit from 2.5.3 to 2.6.0 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/16
* Bump xunit from 2.6.0 to 2.6.1 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/17
* Bump Microsoft.NET.Test.Sdk from 17.7.2 to 17.8.0 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/18
* Bump xunit from 2.6.1 to 2.6.2 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/20
* Bump xunit.runner.visualstudio from 2.5.3 to 2.5.4 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/21
* Bump Microsoft.CodeAnalysis.CSharp from 4.7.0 to 4.8.0 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/22
* Bump xunit from 2.6.2 to 2.6.3 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/23
* Bump xunit.runner.visualstudio from 2.5.4 to 2.5.6 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/25
* Bump xunit from 2.6.3 to 2.6.5 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/27
* Bump xunit from 2.6.5 to 2.6.6 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/28
* Bump Microsoft.NET.Test.Sdk from 17.8.0 to 17.9.0 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/29
* Bump xunit from 2.6.6 to 2.7.0 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/30
* Bump coverlet.collector from 6.0.0 to 6.0.1 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/32
* Bump xunit.runner.visualstudio from 2.5.6 to 2.5.7 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/31
* Bump Microsoft.CodeAnalysis.CSharp from 4.8.0 to 4.9.2 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/33
* Bump coverlet.collector from 6.0.1 to 6.0.2 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/34
* Bump xunit.runner.visualstudio from 2.5.7 to 2.5.8 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/35
* Bump xunit from 2.7.0 to 2.8.0 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/37
* Bump xunit.runner.visualstudio from 2.5.8 to 2.8.0 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/38
* Bump Microsoft.NET.Test.Sdk from 17.9.0 to 17.10.0 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/39
* Bump xunit.runner.visualstudio from 2.8.0 to 2.8.1 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/40
* Bump Microsoft.CodeAnalysis.CSharp from 4.9.2 to 4.10.0 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/42
* Bump xunit from 2.8.0 to 2.8.1 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/41
* Updated CICD by @Kiryuumaru in https://github.com/Kiryuumaru/DisposableHelpers/pull/43
* Bump Microsoft.Bcl.AsyncInterfaces from 7.0.0 to 8.0.0 by @dependabot in https://github.com/Kiryuumaru/DisposableHelpers/pull/19
## New Contributors
* @Kiryuumaru made their first contribution in https://github.com/Kiryuumaru/DisposableHelpers/pull/43
**Full Changelog**: https://github.com/Kiryuumaru/DisposableHelpers/compare/build.7...build.9