开发者

Looking for the exact list of possible MethodAttributes.SpecialName

开发者 https://www.devze.com 2023-01-17 21:04 出处:网络
I am aware of ctor, cctor, property/indexer prefix: get_, set_, event management prefix: add_, remove_.

I am aware of ctor, cctor, property/indexer prefix: get_, set_, event management prefix: add_, remove_. I have seen a raise_ prefix once or twice (do not remember where).

Does a definitive list exists at the .Net level (ECMA spec.)? If yes where is it?

Is it an "open l开发者_运维问答ist" so that any (new) language can define them for its (future) needs?


User defined operators would be another example. Like System.String.op_Equality (operator==):

.method public hidebysig specialname static bool op_Equality(string a, string b) cil managed
{
    .maxstack 8
    L_0000: ldarg.0 
    L_0001: ldarg.1 
    L_0002: call bool System.String::Equals(string, string)
    L_0007: ret 
}

There's no exhaustive list, language implementations are free to use the attribute to hide their glue. You probably saw the raise_ prefix on code generated by the VB.NET compiler using the RaiseEvent accessor for example.

0

精彩评论

暂无评论...
验证码 换一张
取 消