예제 #1
0
        private void CloseUIFormsByHidingOtherType(string UIFormsName)
        {
            if (string.IsNullOrEmpty(UIFormsName))
            {
                return;
            }
            BaseUIForms _baseUIFormsAtDic = null;

            if (!_DicCurShowUIForms.TryGetValue(UIFormsName, out _baseUIFormsAtDic))
            {
                Debug.LogError("要关闭的窗体不存在!!!UIFormsName: " + UIFormsName);
                return;
            }

            _baseUIFormsAtDic.Hiding();
            _DicCurShowUIForms.Remove(UIFormsName);
            _baseUIFormsAtDic = null;

            foreach (BaseUIForms item in _DicCurShowUIForms.Values)
            {
                item.Redisplay();
            }

            foreach (BaseUIForms item in _StaCacheUIForms)
            {
                item.Redisplay();
            }
        }
예제 #2
0
        /// <summary>
        /// 关闭或返回上一个UI窗体(关闭当前UI窗体)
        /// </summary>
        public void CloseOrReturnUIForms(string strUIFormName)
        {
            BaseUIForms baseUIForms = null;                   //UI窗体基类

            /* 参数检查 */
            if (string.IsNullOrEmpty(strUIFormName))
            {
                return;
            }
            //“所有UI窗体缓存”如果没有记录,则直接返回。
            _DicALLUIForms.TryGetValue(strUIFormName, out baseUIForms);
            if (baseUIForms == null)
            {
                baseUIForms.Hiding();
                return;
            }
            /* 判断不同的窗体显示模式,分别进行处理 */
            switch (baseUIForms.CurrentUIType.UIForms_ShowMode)
            {
            case UIFormsShowMode.Normal:
                ExitUIFormsCache(strUIFormName);
                break;

            case UIFormsShowMode.ReverseChange:
                PopUIForms();
                break;

            case UIFormsShowMode.HideOther:
                ExitUIFormsFromCacheAndShowOther(strUIFormName);
                break;

            default:
                break;
            }
        }
예제 #3
0
        private void CloseUIFormsByNormalType(string UIFormsName)
        {
            if (string.IsNullOrEmpty(UIFormsName))
            {
                return;
            }

            BaseUIForms _baseUIFormsAtDic = null;

            if (!_DicCurShowUIForms.TryGetValue(UIFormsName, out _baseUIFormsAtDic))
            {
                Debug.LogError("要关闭的窗体不存在!!!UIFormsName: " + UIFormsName);
                return;
            }

            _baseUIFormsAtDic.Hiding();
            _DicCurShowUIForms.Remove(UIFormsName);
            _baseUIFormsAtDic = null;
        }
예제 #4
0
 /// <summary>
 /// UI窗体出栈逻辑
 /// </summary>
 private void PopUIForms()
 {
     if (_StaCurrentUIForms.Count >= 2)
     {
         /* 出栈逻辑 */
         BaseUIForms topUIForms = _StaCurrentUIForms.Pop();
         //出栈的窗体,进行隐藏处理
         topUIForms.Hiding();
         //出栈窗体的下一个窗体逻辑
         BaseUIForms nextUIForms = _StaCurrentUIForms.Peek();
         //下一个窗体"重新显示"处理
         nextUIForms.Redisplay();
     }
     else if (_StaCurrentUIForms.Count == 1)
     {
         /* 出栈逻辑 */
         BaseUIForms topUIForms = _StaCurrentUIForms.Pop();
         //出栈的窗体,进行"隐藏"处理
         topUIForms.Hiding();
     }
 }