Epiforge.Extensions.Components
1.1.1
See the version list below for details.
dotnet add package Epiforge.Extensions.Components --version 1.1.1
NuGet\Install-Package Epiforge.Extensions.Components -Version 1.1.1
<PackageReference Include="Epiforge.Extensions.Components" Version="1.1.1" />
paket add Epiforge.Extensions.Components --version 1.1.1
#r "nuget: Epiforge.Extensions.Components, 1.1.1"
// Install Epiforge.Extensions.Components as a Cake Addin #addin nuget:?package=Epiforge.Extensions.Components&version=1.1.1 // Install Epiforge.Extensions.Components as a Cake Tool #tool nuget:?package=Epiforge.Extensions.Components&version=1.1.1
Property Change Notification
This library offers the PropertyChangeNotifier
class, which you may inherit from to quickly get all the property utilities we're all tired of copying and pasting everywhere.
Just call the protected OnPropertyChanged
and OnPropertyChanging
methods at the appropriate times from setters and compiler services will figure out what property you're in.
Or, if all you need to do is set the value of a field, SetBackedProperty
couldn't make it any easier or convenient to handle that as efficiently as possible.
DynamicPropertyChangeNotifier
is also available if your class needs to be dynamic.
Be sure to set the protected Logger
property if you want the abstract class to log what's going on with property change notification.
Disposal
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.
Be sure to set the protected Logger
property if you want the abstract class to log what's going on with disposal.
Reflection
This library has useful tools for when you can't be certain of some things at compile time, such as types, methods, etc. While .NET reflection is immensely powerful, prior to .NET 7, it's not very quick. To address this, this library offers the following extension methods which will emit IL, generate delegates, and cache them for expedited use of Reflection:
ConstructorInfo.FastInvoke
: call a constructor only known at runtime quicklyMethodInfo.FastInvoke
: call a method only known at runtime quicklyPropertyInfo.FastGetValue
: get the value of a property only known at runtime quicklyPropertyInfo.FastSetValue
: set the value of a property only known at runtime quicklyType.FastDefault
: get the default value of a type only known at runtime quickly
Use of these methods in .NET 7 or later will simply call the built-in methods, as they are now optimized.
This library also offers FastComparer
and FastEqualityComparer
, which implement IComparer
and IEqualityComaprer
, respectively, but quickly use the methods of Comparer<>.Default
and EqualityComaprer<>.Default
, respectively, to do their work.
Exceptions
This library provides extension methods for dealing with exceptions:
GetFullDetails
- creates a representation of an exception and all of its inner exceptions, including exception types, messages, and stack traces, and traversing multiple inner exceptions in the case ofAggregateException
andReflectionTypeLoadException
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 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. |
.NET Framework | net462 is compatible. 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 | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Ben.Demystifier (>= 0.4.1)
- Microsoft.Extensions.Logging (>= 7.0.0)
- Microsoft.Extensions.ObjectPool (>= 7.0.5)
- Nito.AsyncEx (>= 5.1.2)
- System.Text.Json (>= 7.0.2)
- System.Threading.Tasks.Dataflow (>= 7.0.0)
-
.NETStandard 2.1
- Ben.Demystifier (>= 0.4.1)
- Microsoft.Extensions.Logging (>= 7.0.0)
- Microsoft.Extensions.ObjectPool (>= 7.0.5)
- Nito.AsyncEx (>= 5.1.2)
- System.Text.Json (>= 7.0.2)
- System.Threading.Tasks.Dataflow (>= 7.0.0)
-
net6.0
- Ben.Demystifier (>= 0.4.1)
- Microsoft.Extensions.Logging (>= 7.0.0)
- Microsoft.Extensions.ObjectPool (>= 7.0.5)
- Nito.AsyncEx (>= 5.1.2)
- System.Text.Json (>= 7.0.2)
- System.Threading.Tasks.Dataflow (>= 7.0.0)
-
net7.0
- Ben.Demystifier (>= 0.4.1)
- Microsoft.Extensions.Logging (>= 7.0.0)
- Microsoft.Extensions.ObjectPool (>= 7.0.5)
- Nito.AsyncEx (>= 5.1.2)
- System.Text.Json (>= 7.0.2)
- System.Threading.Tasks.Dataflow (>= 7.0.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Epiforge.Extensions.Components:
Package | Downloads |
---|---|
Epiforge.Extensions.Collections
This package assists in operating with collections. |
|
Epiforge.Extensions.Expressions
This package assists in operating with expressions. |
|
Epiforge.Extensions.Platforms.Windows
This package assists in Windows-platform specific operations. |
|
Epiforge.Extensions.Frameworks.WPF
This package assists in developing WPF-based applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Revised FastDefault not to attempt to use the default keyword for reference types as if they are not public then .NET Framework will throw an exception.