Beispiel #1
0
        /// <summary>
        /// 显示(打开)UI窗体
        /// 功能:
        /// 1: 根据UI窗体的名称,加载到“所有UI窗体”缓存集合中
        /// 2: 根据不同的UI窗体的“显示模式”,分别作不同的加载处理
        /// </summary>
        /// <param name="uiFormName">UI窗体预设的名称</param>
        public void ShowUIForms(string uiFormName, object[] para = null)
        {
            BaseUIForm baseUIForms = null;                    //UI窗体基类

            //参数的检查
            if (string.IsNullOrEmpty(uiFormName))
            {
                return;
            }

            //根据UI窗体的名称,加载到“所有UI窗体”缓存集合中
            baseUIForms = LoadFormsToAllUIFormsCatch(uiFormName);
            if (baseUIForms == null)
            {
                return;
            }

            //参数赋值
            baseUIForms.para = para;

            //是否清空“栈集合”中得数据
            if (baseUIForms.CurrentUIType.IsClearStack)
            {
                ClearStackArray();
            }

            //根据不同的UI窗体的显示模式,分别作不同的加载处理
            switch (baseUIForms.CurrentUIType.UIForms_ShowMode)
            {
            case UIFormShowMode.Normal:                     //“普通显示”窗口模式
                //把当前窗体加载到“当前窗体”集合中。
                LoadUIToCurrentCache(uiFormName);
                break;

            case UIFormShowMode.ReverseChange:              //需要“反向切换”窗口模式
                PushUIFormToStack(uiFormName);
                break;

            case UIFormShowMode.HideOther:                  //“隐藏其他”窗口模式
                EnterUIFormsAndHideOther(uiFormName);
                break;

            default:
                break;
            }
        }
Beispiel #2
0
 //(“反向切换”属性)窗体的出栈逻辑
 private void PopUIFroms()
 {
     if (_StaCurrentUIForms.Count >= 2)
     {
         //出栈处理
         BaseUIForm topUIForms = _StaCurrentUIForms.Pop();
         //做隐藏处理
         topUIForms.Hiding();
         //出栈后,下一个窗体做“重新显示”处理。
         BaseUIForm nextUIForms = _StaCurrentUIForms.Peek();
         nextUIForms.Redisplay();
     }
     else if (_StaCurrentUIForms.Count == 1)
     {
         //出栈处理
         BaseUIForm topUIForms = _StaCurrentUIForms.Pop();
         //做隐藏处理
         topUIForms.Hiding();
     }
 }