private void NotifyFinished(SessionFinishReason reason)
        {
            var handler = SessionFinished;

            if (handler != null)
            {
                handler(reason);
            }
        }
        public void Finish(SessionFinishReason reason)
        {
            if (!_alive)
            {
                return;
            }

            _token          = null;
            _alive          = false;
            _lastAccessTime = 0;
            _currentProfile = null;

            NotifyFinished(reason);
            if (reason == SessionFinishReason.Restart)
            {
                NotifyCurrentProfileChanged();
            }
        }