private void Algorithm_Paused(object sender, EventArgs e) { var action = pausedForTermination ? ExecutionState.Stopped : (pausedForSnapshot ? ExecutionState.Started : ExecutionState.Paused); if (pausedForSnapshot || pausedForTermination) { pausedForSnapshot = pausedForTermination = false; MakeSnapshot(); FindNextSnapshotTimeIndex(ExecutionTime); } OnPaused(); if (action == ExecutionState.Started) { Algorithm.Start(); } else if (action == ExecutionState.Stopped) { Algorithm.Stop(); } }
public void Start() { Algorithm.Start(); }
public void Start(CancellationToken cancellationToken) { Algorithm.Start(cancellationToken); }