/// <inheritdoc/> public override void Detach() { _currentSession?.Detach(); _currentSession = null; MySession.AfterLoading -= SessionLoaded; MySession.OnUnloaded -= SessionUnloaded; }
private void SessionUnloaded() { if (_currentSession == null) { return; } _log.Info($"Unloading torch session for {_currentSession.KeenSession.Name}"); _currentSession.Detach(); _currentSession = null; }
private void SessionUnloaded() { try { if (_currentSession == null) { _log.Warn("Session unloading event occurred when we don't have a session."); return; } _log.Info($"Unloaded torch session for {_currentSession.KeenSession.Name}"); SetState(TorchSessionState.Unloaded); _currentSession = null; } catch (Exception e) { _log.Error(e); throw; } }
private void SessionLoaded() { if (_currentSession != null) { _log.Warn($"Override old torch session {_currentSession.KeenSession.Name}"); _currentSession.Detach(); } _log.Info($"Starting new torch session for {MySession.Static.Name}"); _currentSession = new TorchSession(Torch, MySession.Static); foreach (SessionManagerFactoryDel factory in _factories) { IManager manager = factory(CurrentSession); if (manager != null) { CurrentSession.Managers.AddManager(manager); } } (CurrentSession as TorchSession)?.Attach(); }
private void SessionLoading() { try { if (_currentSession != null) { _log.Warn($"Override old torch session {_currentSession.KeenSession.Name}"); _currentSession.Detach(); } _log.Info($"Starting new torch session for {MySession.Static.Name}"); _currentSession = new TorchSession(Torch, MySession.Static); SetState(TorchSessionState.Loading); } catch (Exception e) { _log.Error(e); throw; } }