On Wed, 08 Oct 2008 11:59:58 -0700, puzzlecracker <ir*********@gmail.com>
wrote:
I have about 100 of this sort in my main clas, and I would like to put
them into interface:
in Main class:
public event onFooHandler OnFoo { add { m_dispatcher.onFoo +=
value; } remove { m_dispatcher.onFoo -= value; } }
....
First of all, there's no such thing as an "event property".
Secondly, are you asking whether the interface can include the
_implementation_? Or you just want to include the event as required as
part of some other class's implementation of the interface?
Thirdly, this is yet another one of those "why don't you just write the
code and see what the compiler says?" questions. So, I recommend you just
write the code and see what the compiler says. If you have some specific
question about the results once you've put that much effort into the
question, please feel free to come back and post _that_.
For what it's worth, I'm not convinced that having 100 of _anything_ in an
interface makes much sense. The whole point of an interface is to declare
some small subset of functionality that can be implemented by a variety of
disparate classes. It's hard to believe that any collection of 100
somethings could exist in any disparate classes; that's more likely to be
something implemented only in a single class hierarchy, and so it's more
likely that sort of thing belongs in a base class rather than an interface.
Pete