private void MenuItemCallback(object sender, EventArgs e) { try { var dte = (DTE2)ServiceProvider.GetService(typeof(DTE)); var model = new Model(Path.GetDirectoryName(dte.Solution.FullName)); ShowIndependentProjects(model); } catch (Exception exception) { MessageWriter.Exception(exception.Message); } }
private static void OptimizeAndBuild(DTE2 dte, Model model) { var projectsToOptimize = GetSelectedProjects(dte, model); var buildConfig = dte.Solution.SolutionBuild.ActiveConfiguration.Name; model.Optimize(projectsToOptimize); switch (buildConfig) { case "Debug": ModelBuilder.BuildDebug(model); break; case "Release": ModelBuilder.BuildRelease(model); break; default: MessageWriter.Exception("Unknown build configuration"); break; } }