Created
February 7, 2015 23:59
-
-
Save svick/2d6ce35f9608fe5e7e7f to your computer and use it in GitHub Desktop.
Delegate with static member
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
.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() | |
} | |
} | |
} |
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
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