Declare the class containing the event:
class MyClass {
public event EventHandler MyEvent;
public void Method() {
OnEvent();
}
private void OnEvent() {
if (MyEvent != null) {
MyEvent(this, EventArgs.Empty);
}
}
}
Use it like this:
MyClass myObject = new MyClass();
myObject.MyEvent += new EventHandler(myObject_MyEvent);
myObject.Method();