private void PauseCurrentTrace()
{
if (CurrentTrace == null) return;
StatusErrorCode errorCode = CurrentTrace.Profiler.Stop();
if(errorCode == StatusErrorCode.TraceIsInvalid)
{
MessageBox.Show("Could not find the trace. Please close the trace and start a new.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else if (errorCode != StatusErrorCode.NoError)
{
MessageBox.Show("Can't pause trace: " + errorCode, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}