public void Dispose() { TypeEventSystem.UnRegister <IEditorStrangeMVCCommand>(OnCommandExecute); Container.Clear(); Container = null; }
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); }
public void Dispose() { TypeEventSystem.UnRegister <IPackageLoginCommand>(OnCommandExecute); mContainer.Clear(); mContainer = null; }
public void Register <T> (Action <T> onReceive) { TypeEventSystem.Register <T>(onReceive); mUnRegisterEventActions.Add(() => { TypeEventSystem.UnRegister <T>(onReceive); }); }
public void OnDispose() { TypeEventSystem.UnRegister <PackageManagerViewUpdate>(OnRefresh); mScrollLayout = null; mCategoriesSelectorView = null; mPackageManagerApp.Dispose(); mPackageManagerApp = null; }
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); }
public void UnRegister <T>(Action <T> onReceive) { TypeEventSystem.UnRegister <T>(onReceive); }
protected override void Dispose(bool disposing) { TypeEventSystem.UnRegister <LoginSucceed>(OnLoginSucceed); }
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); }
private void OnDestroy() { TypeEventSystem.UnRegister <MissionExpelledNotification>(OnExpelOne); }