In C# why can't I pass another class' EventHandler reference and how can I get around it?
If I have ClassA that has a public event, SomeEvent, and ClassC that has method, addListener, that accepts an EventHandler reference, why can't ClassB have a line that says c.addListener(ref a.SomeEvent)? If I try I get a compiler error that says: "The event 'ClassA.SomeEvent' can only appear on the left hand side of += or -= (except when used from within the type 'ClassA'). Why does this restriction exist? And how can I get around it while staying reasonably close to my structure? I'm a C# newbie; any help would be appreciated. Thanks! class ClassA { public event EventHandler SomeEvent; }