示例#1
0
        /// <summary>
        /// 初始化模板窗体
        /// </summary>
        void InitTempWin(bool blScale, bool blNcc, bool blScaleT, bool blNccT)
        {
            try
            {
                int i = 0;
                while (i < 20 &&
                       !BlInitComprehensiveWin)
                {
                    i++;
                    Thread.Sleep(500);
                }

                this.Dispatcher.Invoke(new Action(() =>
                {
                    bool blNew = false;
                    if (blScale)
                    {
                        WinTempScaledShape.GetWinInst(out blNew).Show();
                        WinTempScaledShape.GetWinInst().Hide();
                        //WinTempScaledShape.GetWinInst().Topmost = true;
                    }
                    if (blNcc)
                    {
                        WinTempNcc.GetWinInst(out blNew).Show();
                        WinTempNcc.GetWinInst().Hide();
                        //WinTempNcc.GetWinInst().Topmost = true;
                    }
                    if (blScaleT)
                    {
                        WinScaledShapeT.GetWinInst(out blNew).Show();
                        WinScaledShapeT.GetWinInst().Hide();
                        //WinTempScaledShape.GetWinInst().Topmost = true;
                    }
                    if (blNccT)
                    {
                        WinNccT.GetWinInst(out blNew).Show();
                        WinNccT.GetWinInst().Hide();
                        //WinTempNcc.GetWinInst().Topmost = true;
                    }
                }));
            }
            catch (Exception ex)
            {
                Log.L_I.WriteError(NameClass, ex);
            }
            finally
            {
                BlInitComprehensiveTempWin = true;
                FinishInitWin();//结束初始化
            }
        }
示例#2
0
 /// <summary>
 /// 初始化模板窗体
 /// </summary>
 /// <param name="blScale"></param>
 /// <param name="blNcc"></param>
 /// <param name="blScaleT"></param>
 /// <param name="blNccT"></param>
 public void InitTempWin(bool blScale, bool blNcc, bool blScaleT, bool blNccT)
 {
     try
     {
         ShowState("预加载模板窗体");
         Application.Current.Dispatcher.Invoke(new Action(() =>
         {
             bool blNew = false;
             if (blScale)
             {
                 WinTempScaledShape.GetWinInst(out blNew).Show();
                 WinTempScaledShape.GetWinInst().Hide();
                 //WinTempScaledShape.GetWinInst().Topmost = true;
             }
             if (blNcc)
             {
                 WinTempNcc.GetWinInst(out blNew).Show();
                 WinTempNcc.GetWinInst().Hide();
                 //WinTempNcc.GetWinInst().Topmost = true;
             }
             if (blScaleT)
             {
                 WinScaledShapeT.GetWinInst(out blNew).Show();
                 WinScaledShapeT.GetWinInst().Hide();
                 //WinTempScaledShape.GetWinInst().Topmost = true;
             }
             if (blNccT)
             {
                 WinNccT.GetWinInst(out blNew).Show();
                 WinNccT.GetWinInst().Hide();
                 //WinTempNcc.GetWinInst().Topmost = true;
             }
         }));
     }
     catch (Exception ex)
     {
         Log.L_I.WriteError(NameClass, ex);
     }
     finally
     {
     }
 }