/// <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(); }