/// <summary> /// Toggle the status of the DefaultEventListener in the ETW logger to supress or enable /// ETW messages on attached debuggers like the Visual Studio debugger on the Output window. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DefaultEventListenerButton_Click(object sender, EventArgs e) { // toggle the status DefaultEventListenerEnabled = !DefaultEventListenerEnabled; if (DefaultEventListenerEnabled) { DiceThrow.EnableDefaultEventListener(); DefaultEventListenerButton.Text = "Disable DefaultEventListener"; } else { // Suppress ETW DefaultEventListener messages from appearing // on attached debuggers. They will still be logged by the EventListenerStub's // iMELLogger in Program.cs, but won't appear Visual Studio Output window twice. DiceThrow.DisableDefaultEventListener(); DefaultEventListenerButton.Text = "Enable DefaultEventListener"; } }