diff --git a/FineCodeCoverage/FineCodeCoverage.csproj b/FineCodeCoverage/FineCodeCoverage.csproj
index cff6100b..18975232 100644
--- a/FineCodeCoverage/FineCodeCoverage.csproj
+++ b/FineCodeCoverage/FineCodeCoverage.csproj
@@ -170,6 +170,7 @@
+
@@ -228,6 +229,7 @@
Resources\LICENSE
true
+
true
diff --git a/FineCodeCoverage/Output/ClearUICommand.cs b/FineCodeCoverage/Output/ClearUICommand.cs
new file mode 100644
index 00000000..a2fb644b
--- /dev/null
+++ b/FineCodeCoverage/Output/ClearUICommand.cs
@@ -0,0 +1,83 @@
+using System;
+using System.ComponentModel.Design;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using FineCodeCoverage.Engine;
+using Microsoft.VisualStudio.Shell;
+using Microsoft.VisualStudio.Shell.Interop;
+using Task = System.Threading.Tasks.Task;
+
+namespace FineCodeCoverage.Output
+{
+ ///
+ /// Command handler
+ ///
+ internal sealed class ClearUICommand
+ {
+ ///
+ /// Command ID.
+ ///
+ public const int CommandId = 256;
+
+ ///
+ /// Command menu group (command set GUID).
+ ///
+ public static readonly Guid CommandSet = new Guid("d58a999f-4a1b-42df-839a-cb31a0a4fed7");
+
+ private readonly IFCCEngine fccEngine;
+
+ ///
+ /// Initializes a new instance of the class.
+ /// Adds our command handlers for menu (commands must exist in the command table file)
+ ///
+ /// Owner package, not null.
+ /// Command service to add command to, not null.
+ private ClearUICommand(OleMenuCommandService commandService, IFCCEngine fccEngine)
+ {
+ this.fccEngine = fccEngine;
+ commandService = commandService ?? throw new ArgumentNullException(nameof(commandService));
+
+ var menuCommandID = new CommandID(CommandSet, CommandId);
+ var menuItem = new MenuCommand(this.Execute, menuCommandID);
+ commandService.AddCommand(menuItem);
+ }
+
+ ///
+ /// Gets the instance of the command.
+ ///
+ public static ClearUICommand Instance
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Initializes the singleton instance of the command.
+ ///
+ /// Owner package, not null.
+ public static async Task InitializeAsync(AsyncPackage package, IFCCEngine fccEngine)
+ {
+ // Switch to the main thread - the call to AddCommand in ClearUICommand's constructor requires
+ // the UI thread.
+ await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);
+
+ OleMenuCommandService commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;
+ Instance = new ClearUICommand(commandService, fccEngine);
+ }
+
+ ///
+ /// This function is the callback used to execute the command when the menu item is clicked.
+ /// See the constructor to see how the menu item is associated with this function using
+ /// OleMenuCommandService service and MenuCommand class.
+ ///
+ /// Event sender.
+ /// Event args.
+ private void Execute(object sender, EventArgs e)
+ {
+ ThreadHelper.ThrowIfNotOnUIThread();
+ fccEngine.ClearUI();
+ }
+
+ }
+}
diff --git a/FineCodeCoverage/Output/OutputToolWindowPackage.cs b/FineCodeCoverage/Output/OutputToolWindowPackage.cs
index 7bc98ace..f6ca424f 100644
--- a/FineCodeCoverage/Output/OutputToolWindowPackage.cs
+++ b/FineCodeCoverage/Output/OutputToolWindowPackage.cs
@@ -75,6 +75,7 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
componentModel = sp.GetService(typeof(Microsoft.VisualStudio.ComponentModelHost.SComponentModel)) as Microsoft.VisualStudio.ComponentModelHost.IComponentModel;
Assumes.Present(componentModel);
await OutputToolWindowCommand.InitializeAsync(this);
+ await ClearUICommand.InitializeAsync(this, componentModel.GetService());
}
protected override System.Threading.Tasks.Task