Exemple #1
0
 /// <summary>
 /// 显示等待Panel
 /// </summary>
 /// <param name="ctrl"></param>
 /// <param name="waitingMsg"></param>
 public static void ShowWaitingPanel(this Control ctrl, string waitingMsg = "数据加载中")
 {
     lock (_waitingPanelCache)
     {
         if (!_waitingPanelCache.ContainsKey(ctrl))
         {
             _waitingPanelCache[ctrl] = new WaitingPanel();
             ctrl.Disposed           += (sender, args) =>
             {
                 _waitingPanelCache[ctrl].Dispose();
                 _waitingPanelCache.Remove(ctrl);
             };
         }
         _waitingPanelCache[ctrl].Show(ctrl, waitingMsg);
     }
 }
Exemple #2
0
 /// <summary>
 /// 显示等待Panel
 /// </summary>
 /// <param name="ctrl"></param>
 /// <param name="getDataMethod"></param>
 /// <param name="getDataCompleteMethod"></param>
 /// <param name="waitingMsg"></param>
 public static void ShowWaitingPanel(this Control ctrl, TmoComm.LongTimeMethodDelegate getDataMethod, ParameterizedThreadStart getDataCompleteMethod,
                                     string waitingMsg = "数据加载中")
 {
     lock (_waitingPanelCache)
     {
         if (!_waitingPanelCache.ContainsKey(ctrl))
         {
             _waitingPanelCache[ctrl] = new WaitingPanel();
             ctrl.Disposed           += (sender, args) =>
             {
                 _waitingPanelCache[ctrl].Dispose();
                 _waitingPanelCache.Remove(ctrl);
             };
         }
         _waitingPanelCache[ctrl].Show(ctrl, getDataMethod, getDataCompleteMethod, waitingMsg);
     }
 }