cleanest proceed plead cross-thread events
i .net eventuality denote such i'll mostly lifting an eventuality thread listening another thread. i wondering cleanest proceed organise an eventuality credentials thread onto ui thread is.
based village suggestions, i've used this:
// surpassing code
mcoolobject.coolevent+=
new coolobjecteventhandler(mcoolobject_coolevent);
// then
private vacant mcoolobject_coolevent(object sender, coolobjecteventargs args)
{
(invokerequired)
{
coolobjecteventhandler cb =
new coolobjecteventhandler(
mcoolobject_coolevent);
invoke(cb, new object[] { sender, args });
return;
}
// unwashed work slight here
}
Comments
Post a Comment