コード例 #1
0
    /// <summary>
    /// 出栈需要返回界面(栈顶),显示界面,
    /// </summary>
    /// <param name="wnd"></param>
    public static void BackPopup(string name)
    {
        UI3WndType type = GetWndType(name);

        if (UI3WndType.ReturnFullScreen != type)
        {
            return;
        }
        UIStack <string> stack    = GetStackByWndName(name);
        string           lastName = Peek(stack);

        lastName = GetValid(lastName, false);
        stack.DisplayList();
        if (string.IsNullOrEmpty(lastName) == true)
        {
            return;
        }
        UI3Wnd wnd = createWindow(lastName);

        if (wnd == null)
        {
            return;
        }
        int index = stack.FindLastByName(GetValid(lastName, true));

        stack.PopAt(index);
        wnd.show();
        stack.DisplayList();
    }
コード例 #2
0
    /// <summary>
    /// 根据不同layer,出栈,在获取上一个bringTop界面,在进行bringTop操作,
    /// 该方法只适用于ReturnFullScreen界面,
    /// </summary>
    /// <param name="name"></param>
    public static void PopBack(string name)
    {
        if (IsVaild(name, false) == false)
        {
            return;
        }
        string           panelLayer = GetPanelLayer(name);
        UIStack <string> stack      = GetStackByPanelLayer(panelLayer);

        if (stack == null)
        {
            return;
        }
        stack.DisplayList();

        int index = stack.FindFirstByName(name);

        if (index < 0)
        {
            return;
        }
        //if(CanPopBack(name,index,stack) == false)
        //    return;
        bool   isTop   = stack.IsTop(name);
        bool   isPopup = true;
        UI3Wnd wnd     = findWindow(name);

        if (wnd != null)
        {
            isPopup = wnd.isHideOnFullScreen;
        }
        if (isPopup == false)
        {
            return;
        }
        stack.PopAt(index);
    }
コード例 #3
0
    /// <summary>
    /// bringTop当前栈界面,
    /// </summary>
    /// <param name="name"></param>
    public static void UIStackBringTop(string name, bool isClearStack = false)
    {
        string           panelLayer = GetPanelLayer(name);
        UIStack <string> stack      = GetStackByPanelLayer(panelLayer);

        if (stack == null)
        {
            return;
        }
        stack.DisplayList();
        string pushName = GetValid(name, true);

        if (stack.Have(name) == false && stack.Have(pushName) == false)
        {
            return;
        }
        if (stack.IsTop(name) == true)
        {
            return;
        }

        /****
        *
        *  UI3WndType wndType = UI3WndType.None;
        *  UI3WndType nextWndType = UI3WndType.None;
        *  //UI3WndType lastWndType = UI3WndType.None;
        *  int nextIndex = -1;
        *  wndType = GetWndType(name);
        *  int index = stack.FindFirstByName(name);
        *  if (index < 0)
        *   return;
        *  string nextName = stack.FindDifferenct(index,name,out nextIndex);
        *  if(string.IsNullOrEmpty(nextName) == false)
        *  {
        *   nextWndType = GetWndType(nextName);
        *   int lastIndex = -1;
        *   string lastName = stack.FindDifferenct(index,name,out lastIndex,false);
        *   if (nextWndType == UI3WndType.ReturnFullScreen)
        *   {
        *       if (lastIndex < 0)
        *       {
        *           stack.PopAt(nextIndex - 1);
        *       }
        *       else
        *       {
        *           stack.SetAt(nextIndex - 1,lastName);
        *       }
        *   }
        *  }
        *  stack.PopAt(index);
        *  if (wndType == UI3WndType.ReturnFullScreen)
        *  {
        *   stack.PopAt(index - 1);
        *  }
        **
        ****/
        //当前界面存在,当前复制界面存在,
        if (stack.Have(name) && stack.Have(pushName))
        {
            int    index    = stack.FindFirstByName(name);
            string lastName = stack.Peek(index - 1);
            //上一个界面不为空,上一个界面没有被复制,需要被复制,
            if (string.IsNullOrEmpty(lastName) == false && IsVaild(lastName, true) == false)
            {
                stack.SetAt(index, GetValid(lastName, true));
            }
        }
        //只是当前界面存在,同时,上一个元素是当前界面的复制界面,所以需要清除复制界面,
        else if (stack.Have(name))
        {
            int    index    = stack.FindFirstByName(name);
            string lastName = stack.Peek(index - 1);
            if (string.IsNullOrEmpty(lastName) == false && IsVaild(lastName, true) == true)
            {
                stack.PopAt(lastName);
            }
        }
        //只是当前界面复制界面存在,需要判断上一个界面是否被复制,没有复制就复制上一个界面,
        else
        {
            int    index    = stack.FindFirstByName(pushName);
            string lastName = stack.Peek(index - 1);
            if (string.IsNullOrEmpty(lastName) == false && IsVaild(lastName, true) == false)
            {
                stack.SetAt(index, GetValid(lastName, true));
            }
        }
        //出栈当前界面原界面和复制界面,
        stack.PopAt(name);
        stack.PopAt(pushName);
        PushBack(name);
        stack.DisplayList();
    }