Exemplo n.º 1
0
 private bool ShowWarningDialog()
 {
     return(OrchestratorPackage.ShowSecurityDialogDuringBatchRun && OrchestratorOptionsAutomation.ShowSecurityWarningDialog(base.GlobalServiceProvider));
 }
Exemplo n.º 2
0
 private void OnMenuGenerateAllCode(object sender, EventArgs e)
 {
     if (OrchestratorOptionsAutomation.ShowSecurityWarningDialog(this.ServiceProvider))
     {
         this.WriteLine();
         this.WriteLine(Microsoft.VisualStudio.TextTemplating.VSHost.Resources.TransformationCancelled);
     }
     else
     {
         Microsoft.VisualStudio.TextTemplating.VSHost.OrchestratorPackage.ShowSecurityDialogDuringBatchRun = false;
         try
         {
             if (((this.Dte.Solution != null) && (this.Dte.Solution.Projects != null)) && !this.SaveAllOpenFiles())
             {
                 Application.DoEvents();
                 this.Dte.ExecuteCommand("View.Output", "");
                 this.outputPane.Clear();
                 this.WriteLine();
                 this.WriteLine(Microsoft.VisualStudio.TextTemplating.VSHost.Resources.OrchestratorStartCodeGen);
                 this.WriteLine(Microsoft.VisualStudio.TextTemplating.VSHost.Resources.OrchestrationSeparator);
                 this.outputPane.Activate();
                 this.BeginErrorSession();
                 Application.DoEvents();
                 List <ProjectItem> toProcess = new List <ProjectItem>();
                 foreach (Project project in this.Dte.Solution.Projects)
                 {
                     this.FindProjectItems(project, toProcess);
                 }
                 bool         flag2     = false;
                 IVsStatusbar service   = this.ServiceProvider.GetService(typeof(IVsStatusbar)) as IVsStatusbar;
                 uint         pdwCookie = 0;
                 uint         count     = (uint)toProcess.Count;
                 if (service != null)
                 {
                     service.Progress(ref pdwCookie, 1, Microsoft.VisualStudio.TextTemplating.VSHost.Resources.TextTemplatingStatusBarLabel, 0, count);
                 }
                 this.codeMarkers.CodeMarker(Microsoft.Internal.Performance.CodeMarkerEvent.perfVSWhitehorseT4CodeGenerationBegin);
                 uint nComplete = 1;
                 foreach (ProjectItem item in toProcess)
                 {
                     Application.DoEvents();
                     if (item != null)
                     {
                         flag2 |= this.RunCustomTool(item);
                     }
                     if (service != null)
                     {
                         service.Progress(ref pdwCookie, 1, Microsoft.VisualStudio.TextTemplating.VSHost.Resources.TextTemplatingStatusBarLabel, nComplete, count);
                     }
                     nComplete += 1;
                     Application.DoEvents();
                 }
                 this.codeMarkers.CodeMarker(Microsoft.Internal.Performance.CodeMarkerEvent.perfVSWhitehorseT4CodeGenerationEnd);
                 this.WriteLine(Microsoft.VisualStudio.TextTemplating.VSHost.Resources.OrchestrationSeparator);
                 this.WriteLine(Microsoft.VisualStudio.TextTemplating.VSHost.Resources.OrchestratorEndCodeGen);
                 this.EndErrorSession();
                 if (service != null)
                 {
                     service.Progress(ref pdwCookie, 0, string.Empty, count, count);
                 }
                 this.ExecuteCommandIfEnabled("View.SolutionExplorer");
                 this.ExecuteCommandIfEnabled("View.Refresh");
                 if (flag2)
                 {
                     this.ExecuteCommandIfEnabled("View.ErrorList");
                 }
                 else
                 {
                     this.ExecuteCommandIfEnabled("View.Output");
                 }
             }
         }
         finally
         {
             Microsoft.VisualStudio.TextTemplating.VSHost.OrchestratorPackage.ShowSecurityDialogDuringBatchRun = true;
         }
     }
 }