허당 레몬도리

출처 : http://bulkdisk.tistory.com/78

public delegate void ShowButtonDelegate(bool IsShow);
public void ShowButtonCaller(bool IsShow)
{
    if (canvasButtonGroup.Dispatcher.CheckAccess())
        ShowButtonBody(IsShow);
    else
        Dispatcher.Invoke(new ShowButtonDelegate(ShowButtonBody), IsShow);
}
private void ShowButtonBody(bool IsShow)
{
    DebugWrite("ShowButtonBody =" + IsShow.ToString());
}
------------------------------------
윈폼 ----------------------------
this.Invoke(new MethodInvoker(delegate()
{
    mnuConnectServer.Enabled = true;
    mnuStartServer.Enabled = true;
}));
------------------------------------
WPF ----------------------------
MainUI.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, 
new DispatcherOperationCallback(delegate {     MainUI.ResetGame(user.m_nID);     return null
}), null);  


------------------------------------
Invoke : 동기
BeginInvoke : 비동기  

------------------------------------

 

profile

허당 레몬도리

@LemonDory

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!