c# - Can a eventhandler delegate remove itself -


how can eventhandler delegate remove ??

code this

    void timertick(object sender, eventargs e)     {         if (!isholding){             return;         }          utilitystoryboardmanager.playerstoryboard("end", (_) =>{             isholding = false;             //call function or  perform logic             timer.stop();             //how can eventhandler delegate remove ??             //timer.tick -= timertick;         }, null);   } 

are trying this?

void timertick(object sender, eventargs e) {     if (!isholding){         return;     }      utilitystoryboardmanager.playerstoryboard("end", (_) =>{         isholding = false;         //call function or  perform logic         timer.stop();         //how can eventhandler delegate remove ??         //timer.tick -= timertick;     }, null);  (sender timer).tick-=timertick; // removes event } 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -