My base interface IFoo declares
event EventHandler Changed
when I do ‘implement interface’ I get some lame boilerplate code but how do I provide a decent default implementation?
add { throw new NotImplementedException(); }
remove { throw new NotImplementedException(); }
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:
… 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.