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
Post a Comment