Exemple #1
0
        /// <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");
            }
        }
Exemple #2
0
        /// <inheritdoc/>
        public override void EndSnapshot()
        {
            if (!snapshotting)
            {
                throw new InvalidOperationException(dotTraceStrings.SnapshotNotInProgress);
            }

            if (snapshotNextFrameInProgress)
            {
                throw new InvalidOperationException(dotTraceStrings.SnapshottingFrame);
            }

            snapshotting = false;

            ProfilingControl.Stop();
        }
Exemple #3
0
        /// <inheritdoc/>
        public override void BeginSnapshot()
        {
            if (snapshotting)
            {
                throw new InvalidOperationException(dotTraceStrings.SnapshotAlreadyInProgress);
            }

            snapshotting = true;

            if (numberOfActiveEnabledSections > 0)
            {
                ProfilingControl.Start();
            }
            else
            {
                ProfilingControl.StartPaused();
            }
        }