andrew4582

actionInvoke (WinForm) - Invokes an Action if control's property 'InvokeRequired' is true, otherwise just calls the action

Dec 16th, 2011
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.18 KB | None | 0 0
  1.  
  2.     Action actionInvoke = () => {
  3.         //do ui thread protected logic here
  4.  
  5.     };
  6.  
  7.     if(InvokeRequired)
  8.         Invoke(actionInvoke);
  9.     else
  10.         actionInvoke();
Advertisement
Add Comment
Please, Sign In to add comment