Ejemplo n.º 1
0
        public void StopSession()
        {
            if (runningSession == null)
            {
                return;
            }

            autoLogExitCts?.Cancel();
            using (runningSession) {
                runningSession.Stop();
                SessionStopped?.Invoke(runningSession);
                runningSession = null;
            }
        }
Ejemplo n.º 2
0
        public async Task StopSessionAsync()
        {
            if (runningSession == null)
            {
                return;
            }

            autoLogExitCts?.Cancel();
            using (runningSession) {
                await Task.Run(() => runningSession.Stop());

                SessionStopped?.Invoke(runningSession);
                runningSession = null;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Called whenever the <see cref="Session"/> has been stopped.
 /// </summary>
 /// <remarks>
 /// <remarks>
 /// In order for this override and properties like <see cref="IsSessionStarted"/>
 /// to be tracked correctly, use the <see cref="StartSessionAsync"/> and
 /// <see cref="StopSession"/> methods rather than calling methods
 /// directly on the <see cref="Session"/> instance.
 /// </remarks>
 protected virtual void OnSessionStopped()
 {
     SessionStopped?.Invoke(this, EventArgs.Empty);
 }
 public void NotifySessionStopped(SessionStoppedEventArgs args)
 {
     SessionStopped?.Invoke(this, args);
 }