标签:
/// <summary>
/// 界面同步
/// </summary>
private class UISync
{
private static ISynchronizeInvoke Sync;
public static void Init(ISynchronizeInvoke sync)
{
Sync = sync;
}
public static void Execute(Action action)
{
try { Sync.BeginInvoke(action, null); }
catch { }
}
}
使用
UISync.Execute(() => textBox2.Text+= System.Text.Encoding.Unicode.GetString(bt));
标签:
原文地址:http://www.cnblogs.com/wility/p/4304657.html