Skip to content
This repository has been archived by the owner on Oct 14, 2019. It is now read-only.
sergun edited this page Aug 7, 2012 · 1 revision

Events invoking

Before

public class Person
{
   public event EventHandler Updated;

   public void Update()
   {
      if (Updated != null)
      {
           Updated(this, EventArgs.Empty);
      }
   }
}

After

public class Person
{
   public event EventHandler Updated;

   public void Update()
   {
       Updated.Execute(this, EventArgs.Empty);
   }
}

--

Before

public class Person
{
   public event EventHandler Updated;

   public void Update()
   {
      if (Updated != null)
      {
           Updated(this, new CustomEventArgs(...));
      }
   }
}

After

public class Person
{
   public event EventHandler Updated;

   public void Update()
   {
      Updated.Execute(this, new CustomEventArgs(...));
   }
}
Clone this wiki locally