Proper naming convention for a .NET Delegate type?

后端 未结 8 2016
我寻月下人不归
我寻月下人不归 2020-12-12 11:29

By convention classes are often named like nouns, methods like verbs and interfaces like adjectives.

What is the common naming convention for a delegate? Or what\'s

8条回答
  •  渐次进展
    2020-12-12 12:04

    Microsoft's Framework Design Guidelines - the naming almanac for me, says the following on the topic:

    √ DO add the suffix "EventHandler" to names of delegates that are used in events.
    √ DO add the suffix "Callback" to names of delegates other than those used as event handlers.
    X DO NOT add the suffix "Delegate" to a delegate.

提交回复
热议问题