Example #1
0
 void OnOpenView(UView view, bool useGroup)
 {
     //UI互斥,相同UI组只能有一个UI被打开
     if (useGroup && view.Group > 0)
     {
         view.MutexPreviews.Clear();
         for (int i = 0; i < AllMainViews.Count; ++i)
         {
             var otherView = AllMainViews[i];
             if (!otherView.IsDragged &&
                 otherView != view &&
                 otherView.Group != ViewGroup.None &&
                 otherView.Group == view.Group &&
                 otherView.ViewLevel == view.ViewLevel &&
                 otherView.IsExclusive && view.IsExclusive &&
                 otherView.IsShow)
             {
                 view.MutexPreviews.Add(otherView);
                 otherView.Show(false, false);
             }
         }
     }
     if (view.Group == ViewGroup.Main)
     {
         OpenedMainViews.Add(view);
     }
 }
Example #2
0
 // 手动调用:销毁UI
 protected void DoDestroyView()
 {
     RootView?.DoDestroy();
     foreach (var item in MainViews)
     {
         item.DoDestroy();
     }
     AllMainViews.RemoveAll(x => MainViews.Contains(x));
     MainViews.Clear();
     OpenedMainViews.Clear();
     GroupViews.Clear();
     IgnoreBlockClick.Clear();
     IgnoreBlockClickOnce.Clear();
 }
Example #3
0
 void OnCloseView(UView view, bool useGroup)
 {
     if (useGroup && view.Group > 0)
     {
         if (view.IsReturn)
         {
             foreach (var item in view.MutexPreviews)
             {
                 item.Show(true, false);
             }
         }
     }
     if (view.Group == ViewGroup.Main)
     {
         OpenedMainViews.Remove(view);
     }
 }