AnfiniL.SqlExpressProfiler.MainForm.StartCurrentTrace C# (CSharp) Method

StartCurrentTrace() private method

private StartCurrentTrace ( ) : void
return void
        private void StartCurrentTrace()
        {
            if (CurrentTrace == null) return;

            if(CurrentTrace.Profiler.Status == TraceStatus.Closed)
            {
                SetCurrentTrace(_traceManager.RunProfiler(CurrentTrace.Profiler));
                return;
            }

            StatusErrorCode errorCode = CurrentTrace.Profiler.Start();
            if (errorCode != StatusErrorCode.NoError)
            {
                MessageBox.Show("Can't start trace: " + errorCode, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }