Does anybody know tools to view the C# compiler generated code for delegate?
I want to verify the following
class X
{
public event D Ev;
}
Which is compiled to :
class X
{
private D __Ev; // field to hold the delegate
public event D Ev {
add {
lock(this) { __Ev = __Ev + value; }
}
remove {
lock(this) { __Ev = __Ev – value; }
}
}
}
Your question makes no sense, but you’re probably looking for Reflector.
EDIT: Now, your question does make sense. You’re still looking for Reflector.
However, you’ll need to set the Optimization to None in options.
It reveals,