Proper naming convention for a .NET Delegate type?

后端 未结 8 2002
我寻月下人不归
我寻月下人不归 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 11:56

    In case of Events (with Delegates) Windows Forms uses following convention:

    Delegate:

    public delegate void MouseEventHandler(object sender, MouseEventArgs e);
    

    Event:

    public event MouseEventHandler MouseClick;
    

    Event Listener:

    this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseClick);
    

提交回复
热议问题