Beispiel #1
0
 void Update()
 {
     while (closeViewQueue.Count != 0)
     {
         IZView       view       = closeViewQueue.Dequeue();
         IZController controller = viewDic[view];
         view.Close();
         controller.Disabled();
         viewDic.Remove(view);
         controllerDic[controller].Remove(view);
         if (controllerDic.Count <= 0)
         {
             controllerDic.Remove(controller);
         }
     }
 }
Beispiel #2
0
        public IZView OpenView <TView, TController>()
            where TView : class, IZView
            where TController : class, IZController
        {
            IZView       view       = ObjectFactory.GetFactory(FactoryType.Temp).CreateObject <TView>() as IZView;
            IZController controller = ObjectFactory.GetFactory(FactoryType.Temp).CreateObject <IZController>() as IZController;

            if (!viewDic.ContainsKey(view))
            {
                //加载View资源
                //初始化
                view.Init();
                controller.Enabled();
            }
            view.Open();
            return(view);
        }