using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace JianLian.HDIS.PublishHelper.Resources { /// /// /// public static class ControlExtensions { /// /// 异步刷新 /// /// /// public static void InvokeOnUiThreadIfRequired(this Control control, Action action) { if (control.Disposing || control.IsDisposed || !control.IsHandleCreated) { return; } if (control.InvokeRequired) { control.BeginInvoke(action); } else { action.Invoke(); } } } }