If all you're doing is firing an event handler from another event handler, you can cut out the middle man and hook the event handlers directly in the add/remove blocks for the event.
For example, if you have a UserControl with a "SaveButtonClick" event, and all you want to do when is call the event handler when the "SaveButton" on your UserControl is clicked, you can do this:
public event EventHandler SaveButtonClick
{
add { this.SaveButton.Click += value; }
remove { this.SaveButton.Click -= value; }
}
Now you don't need any code to fire the SaveButtonClick event - it will automatically be fired when the SaveButton.Click event is raised (ie when someone clicks that button).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…