Hi,
i need a solution for a problem where I want to raise an event from
a complete different Class. Here my Example.
I have class1 where I want to invoke an Event.
Then I have a 2nd Class which will be executed in a different Thread.
Because I need to check a message queue. If there is something in the
messagequeue which I need I want to invoke an Event in the Class 1.
How can that be done. Please post just a small hello world example.
Thanks.
Calling Events from a different class
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Suthish NairRank #92 · 22.8K reputationPosted Sep 6, 2010, 11:31 AM EDT
create a public shared method, and then call it in class1
Dipal ChoksiRank #199 · 12K reputationPosted Sep 6, 2010, 1:29 PM EDT
The only way to invoke an external object's event would be through reflection and that doesn't result in very clean code.
I would second a public method or encapsulating the event raise in a public method if you need to reuse the same code.
Hope this helps!
Dipal