title: Registering a handler for an event on the current class with a custom delegate
body: <p>I defined an event on my class and I want to make one of the methods of the class a handler for the event.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace DelegatesAndEvents
  {
      class Program
      {
          static void Main(string[] args)
          {
              Person p = new Person();
              p.NameChangeEventHandler += new Person.NameChangeEventHandlerDel;
  
              p.Name = "Paul";
          }
      }
  
      class Person
      {
          #region Events
          public delegate void NameChangeEventHandlerDel(object sender, EventArgs args);
          public event EventHandler NameChangeEventHandler;
          protected void NameChange(EventArgs arg)
          {
              Console.WriteLine("Name change...");
          }
          #endregion
  
          #region Properties
          private string name;
          public string Name
          {
              get { return name; }
              set 
              {
                  NameChange(null);
                  name = value;
              }
          }
          #endregion
  
          public Person(string name = "John")
          {
              this.name = name;
          }
      }
  }
  </code></pre>
  
  <p>How can I register the event handler without having to do it in Main?</p>