How does the interface declare the event with the interface name prefixed on the event name? I'm not sure that's legal C#.
If you can get away without the "IFoo." prefix, just declare the event in your class and let the compiler create the default add/remove handers for you. All you should have to worry about is when to trigger the event:
interface IFoo
{
event EventHandler OnChanged;
}
class MyClass : IFoo
{
public event EventHandler OnChanged;
private FireOnChanged()
{
EventHandler handler = this.OnChanged;
if (handler != null)
{
handler(this, EventArgs.Empty); // with appropriate args, of course...
}
}
}
... Or did I misunderstand about where you're inheriting the event from? is your class derived from an abstract base class which in turn implements an interface (which declares the event)? That could be what you mean, but it wasn't clear in the question.