Exemplo n.º 1
0
 private void AdviseBuildEvents()
 {
     Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.RunAsync(async() =>
     {
         UpdateSolutionEventsListener solutionEventsListener = this;
         await Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
         solutionEventsListener._buildCommandIntercepter = BuildCommandIntercepter.InitializeCommandInterceptor(solutionEventsListener._serviceProvider);
         solutionEventsListener._buildCommandIntercepter.UserInitiatedBuild += solutionEventsListener.OnUserInitiatedBuild;
     });
 }
Exemplo n.º 2
0
 private void UnadviseBuildEvents()
 {
     Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.RunAsync(async() =>
     {
         UpdateSolutionEventsListener solutionEventsListener = this;
         await Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
         if (solutionEventsListener._buildCommandIntercepter == null)
         {
             return;
         }
         solutionEventsListener._buildCommandIntercepter.UserInitiatedBuild -= solutionEventsListener.OnUserInitiatedBuild;
         solutionEventsListener._buildCommandIntercepter.Dispose();
         solutionEventsListener._buildCommandIntercepter = null;
     });
 }
Exemplo n.º 3
0
 public NotificationDisabler(UpdateSolutionEventsListener listener)
 {
     _listener = listener ?? throw new ArgumentNullException(nameof(listener));
     _listener._eventsEnabled = false;
 }