Skip to content

Instantly share code, notes, and snippets.

@mattwarren
Forked from svick/Action.il
Last active August 29, 2015 14:16
Show Gist options
  • Save mattwarren/866ee2a037aad4a7eabd to your computer and use it in GitHub Desktop.
Save mattwarren/866ee2a037aad4a7eabd to your computer and use it in GitHub Desktop.
.assembly ActionTest {}
.assembly extern mscorlib
{
.ver 4:0:0:0
.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
}
.namespace Test
{
.class public auto ansi sealed Action extends [mscorlib]System.MulticastDelegate
{
// copied disassembled code of Action delegate
.method public hidebysig specialname rtspecialname instance void .ctor(object 'object', native int 'method') runtime managed
{
}
.method public hidebysig newslot virtual instance class [mscorlib]System.IAsyncResult BeginInvoke(class [mscorlib]System.AsyncCallback callback, object 'object') runtime managed
{
}
.method public hidebysig newslot virtual instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed
{
}
.method public hidebysig newslot virtual instance void Invoke() runtime managed
{
}
// Empty
.method private hidebysig static void EmptyAction() cil managed
{
ret
}
.method public hidebysig specialname static class Test.Action get_Empty() cil managed
{
ldnull
ldftn void Test.Action::EmptyAction()
newobj instance void Test.Action::.ctor(object, native int)
ret
}
.property class Test.Action Empty()
{
.get class Test.Action Test.Action::get_Empty()
}
}
}
Test.Action action1 = () => { };
action1();
Test.Action action2 = Test.Action.Empty;
action2();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment