DelegateConstraint NuGet Package

This package ultimately lets you constrain generic type parameters to the `System.Delegate` type.

Just replace the problematic constraints and types with the `Ark.IDelegate` stubs which are wiped away without a trace after the assembly is compiled.

If you try to write `class MyClass<T> where T : Delegate { }` the C# compiler won't let you.

Install this package and replace that code with `class MyClass<T> where T : Ark.IDelegate { }`.

If you need to refer to a concrete delegate-constrained class in the same library then instead of `MyClass<Action>` you'd need to write `MyClass<Ark.IDelegate<Action>>` so that the code compiles. Don't worry - all these stubs are removed from the resulting assembly.




Got any DelegateConstraint Question?





Info

Version: 0.1.1
Author(s): Ark-kun
Last Update: Sunday, February 10, 2013
.NET Fiddle: Create the first Fiddle
Project Url: https://github.com/Ark-kun/DelegateConstraint
NuGet Url: https://www.nuget.org/packages/Ark.DelegateConstraint


Install
Install-Package Ark.DelegateConstraint
dotnet add package Ark.DelegateConstraint
paket add Ark.DelegateConstraint
Ark.DelegateConstraint Download (Unzip the "nupkg" after downloading)



Tags



STATS

must-have-score

avg-downloads-per-day

0

days-since-last-release

4064