Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public void HidePopWindow()
 {
     if (currentPop != null)
     {
         currentPop.Hide();
     }
     currentPop = null;
 }
Exemplo n.º 4
0
 public void ReleasePopWindow(PopWindow window)
 {
     pops.Remove(window);
     if (currentPop == window)
     {
         currentPop = null;
     }
     window.Dispose();
 }
Exemplo n.º 5
0
 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();
 }
Exemplo n.º 6
0
 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;
     }
 }