c# - Attaching a method to an event handler -


i'll start off saying i'm new c#, apologize in advance if question obvious.

i'm writing class interacts existing api. api exposes event handler provides callbacks operations.

the event handler prototype looks this:

public event eventhandler<theircallbacktype> callbackhandlers; 

i'm trying add own method called when callbackhandlers invoked api. method looks this:

private void myhandler(object sender, theircallbacktype callback){     // stuff } 

i append method api's handler using:

callbackhandlers += new eventhandler<theircallbacktype>(myhandler); 

however, when run code never receive indication method has been called... have messed up?

edit: sorry if unclear, i'm trying add method api's event handler, invoked when api issues callback. i'm not trying fire events application; api this.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -