protected object ShowPopWindow(Type type, object obj = null, ModelElement parent = null) { if (currentPop != null) { currentPop.Hide(); currentPop = null; } for (int i = 0; i < pops.Count; i++) { if (pops[i].GetType() == type) { currentPop = pops[i]; pops[i].Show(obj); return(pops[i]); } } var t = Activator.CreateInstance(type) as PopWindow; pops.Add(t); currentPop = t; if (parent == null) { t.Initial(Parent, this, obj); } else { t.Initial(parent, this, obj); } t.ReSize(); return(t); }
protected T ShowPopWindow <T>(object obj = null, huqiang.UI.ModelElement parent = null) where T : PopWindow, new() { if (currentPop != null) { currentPop.Hide(); currentPop = null; } for (int i = 0; i < pops.Count; i++) { if (pops[i] is T) { currentPop = pops[i]; pops[i].Show(obj); return(pops[i] as T); } } var t = new T(); pops.Add(t); currentPop = t; if (parent == null) { t.Initial(Parent, this, obj); } else { t.Initial(parent, this, obj); } t.ReSize(); return(t); }
public void HidePopWindow() { if (currentPop != null) { currentPop.Hide(); } currentPop = null; }
public void ReleasePopWindow(PopWindow window) { pops.Remove(window); if (currentPop == window) { currentPop = null; } window.Dispose(); }
public override void Dispose() { if (pops != null) { for (int i = 0; i < pops.Count; i++) { pops[i].Dispose(); } } pops.Clear(); currentPop = null; model.SetParent(null); ModelManagerUI.RecycleElement(model); ClearUI(); }
public void ReleasePopWindow <T>() { for (int i = 0; i < pops.Count; i++) { if (pops[i] is T) { pops[i].Dispose(); pops.RemoveAt(i); break; } } if (currentPop is T) { currentPop = null; } }