/// <summary> /// Processes the specified change to the profiler's control state. /// </summary> private void HandleControlState(String name, ControlState state) { switch (state) { case ControlState.Unchanged: break; case ControlState.Resume: if (snapshotting) { ProfilingControl.Resume(); } break; case ControlState.Pause: if (snapshotting) { ProfilingControl.Pause(); } break; default: throw new ArgumentOutOfRangeException("state"); } }
/// <inheritdoc/> public override void EndSnapshot() { if (!snapshotting) { throw new InvalidOperationException(dotTraceStrings.SnapshotNotInProgress); } if (snapshotNextFrameInProgress) { throw new InvalidOperationException(dotTraceStrings.SnapshottingFrame); } snapshotting = false; ProfilingControl.Stop(); }
/// <inheritdoc/> public override void BeginSnapshot() { if (snapshotting) { throw new InvalidOperationException(dotTraceStrings.SnapshotAlreadyInProgress); } snapshotting = true; if (numberOfActiveEnabledSections > 0) { ProfilingControl.Start(); } else { ProfilingControl.StartPaused(); } }