Exemplo n.º 1
0
 public static BuildCommandIntercepter InitializeCommandInterceptor(IServiceProvider serviceProvider)
 {
     if (BuildCommandIntercepter.instance == null)
     {
         BuildCommandIntercepter.instance = new BuildCommandIntercepter(serviceProvider);
     }
     return(BuildCommandIntercepter.instance);
 }
Exemplo n.º 2
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.º 3
0
 int IOleCommandTarget.Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 {
     if (pvaOut == IntPtr.Zero && (BuildCommandIntercepter.IsBuildCommand(pguidCmdGroup, nCmdID) || this.IsProgrammaticBuildCmd(pguidCmdGroup, nCmdID)))
     {
         EventHandler <BuildCommandEventArgs> userInitiatedBuild = this.userInitiatedBuild;
         if (userInitiatedBuild != null)
         {
             BuildCommandEventArgs e = new BuildCommandEventArgs(this.IsBuildClean(pguidCmdGroup, nCmdID));
             userInitiatedBuild((object)this, e);
         }
     }
     return(-2147221248);
 }