Created
December 1, 2014 23:58
-
-
Save vors/4d96fb04fbe124c464eb to your computer and use it in GitHub Desktop.
Generate signatures for C# delegates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Action([int]$i) | |
{ | |
'public delegate void Action<' + [string]::Join(", ", (1..$i | %{"in T$_"})) + '>(' + [string]::Join(", ", (1..$i | %{"T$_ arg$_"})) + ');' | |
} | |
function Get-Func([int]$i) | |
{ | |
'public delegate TResult Func<' + [string]::Join(", ", (1..$i | %{"in T$_"})) + ', out TResult>(' + [string]::Join(", ", (1..$i | %{"T$_ arg$_"})) + ');' | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment