public void StopSession() { if (runningSession == null) { return; } autoLogExitCts?.Cancel(); using (runningSession) { runningSession.Stop(); SessionStopped?.Invoke(runningSession); runningSession = null; } }
public async Task StopSessionAsync() { if (runningSession == null) { return; } autoLogExitCts?.Cancel(); using (runningSession) { await Task.Run(() => runningSession.Stop()); SessionStopped?.Invoke(runningSession); runningSession = null; } }
/// <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); }