Ejemplo n.º 1
0
        public void Dispose()
        {
            TypeEventSystem.UnRegister <IEditorStrangeMVCCommand>(OnCommandExecute);

            Container.Clear();
            Container = null;
        }
Ejemplo n.º 2
0
        public void TypeEventSystem_UnRegisterTest()
        {
            var receivedCount = 0;

            Action <string> onReceive = (msg) => { receivedCount++; };

            TypeEventSystem.Register(onReceive);
            TypeEventSystem.Register(onReceive);
            TypeEventSystem.Register(onReceive);
            TypeEventSystem.Register(onReceive);
            TypeEventSystem.Register(onReceive);

            TypeEventSystem.UnRegister(onReceive);
            TypeEventSystem.UnRegister(onReceive);
            TypeEventSystem.UnRegister(onReceive);


            TypeEventSystem.Send("Hello");

            Assert.AreEqual(receivedCount, 2);

            // 为了避免影响其他的单元测试,所以要注销一下
            TypeEventSystem.UnRegister(onReceive);
            TypeEventSystem.UnRegister(onReceive);
        }
Ejemplo n.º 3
0
        public void Dispose()
        {
            TypeEventSystem.UnRegister <IPackageLoginCommand>(OnCommandExecute);

            mContainer.Clear();
            mContainer = null;
        }
Ejemplo n.º 4
0
 public void Register <T> (Action <T> onReceive)
 {
     TypeEventSystem.Register <T>(onReceive);
     mUnRegisterEventActions.Add(() =>
     {
         TypeEventSystem.UnRegister <T>(onReceive);
     });
 }
Ejemplo n.º 5
0
        public void OnDispose()
        {
            TypeEventSystem.UnRegister <PackageManagerViewUpdate>(OnRefresh);

            mScrollLayout           = null;
            mCategoriesSelectorView = null;
            mPackageManagerApp.Dispose();
            mPackageManagerApp = null;
        }
Ejemplo n.º 6
0
        public void TypeEventSystem_RegisterTest()
        {
            var receivedMsg = string.Empty;

            Action <string> onReceive = (msg) => { receivedMsg = msg; };

            TypeEventSystem.Register(onReceive);

            TypeEventSystem.Send("Hello");

            Assert.AreEqual(receivedMsg, "Hello");

            // 为了避免影响其他的单元测试,所以要注销一下
            TypeEventSystem.UnRegister(onReceive);
        }
Ejemplo n.º 7
0
 public void UnRegister <T>(Action <T> onReceive)
 {
     TypeEventSystem.UnRegister <T>(onReceive);
 }
Ejemplo n.º 8
0
 protected override void Dispose(bool disposing)
 {
     TypeEventSystem.UnRegister <LoginSucceed>(OnLoginSucceed);
 }
Ejemplo n.º 9
0
 private void OnDestroy()
 {
     TypeEventSystem.UnRegister <PartyNotification>(OnPartyNotify);
     TypeEventSystem.UnRegister <MissionCompletedNotification>(OnMissionCompleteNotify);
     TypeEventSystem.UnRegister <MissionExpelledNotification>(OnMissionExpelledNotify);
 }
 private void OnDestroy()
 {
     TypeEventSystem.UnRegister <GameStartEvent>(OnGameStartEvent);
     TypeEventSystem.UnRegister <GameOverEvent>(OnGameOverEvent);
     TypeEventSystem.UnRegister <ISkillEvent>(OnSkillEvent);
 }
Ejemplo n.º 11
0
 private void OnDestroy()
 {
     TypeEventSystem.UnRegister <MissionExpelledNotification>(OnExpelOne);
 }