示例#1
0
        public void Dispose()
        {
            TypeEventSystem.UnRegister <IEditorStrangeMVCCommand>(OnCommandExecute);

            Container.Clear();
            Container = null;
        }
示例#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);
        }
示例#3
0
        public void Dispose()
        {
            TypeEventSystem.UnRegister <IPackageLoginCommand>(OnCommandExecute);

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

            mScrollLayout           = null;
            mCategoriesSelectorView = null;
            mPackageManagerApp.Dispose();
            mPackageManagerApp = null;
        }
示例#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);
        }
示例#7
0
 public void UnRegister <T>(Action <T> onReceive)
 {
     TypeEventSystem.UnRegister <T>(onReceive);
 }
示例#8
0
 protected override void Dispose(bool disposing)
 {
     TypeEventSystem.UnRegister <LoginSucceed>(OnLoginSucceed);
 }
示例#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);
 }
示例#11
0
 private void OnDestroy()
 {
     TypeEventSystem.UnRegister <MissionExpelledNotification>(OnExpelOne);
 }