public override Gtk.Widget CreatePanelWidget() { bool byDefault, require; MSBuildProjectService.CheckHandlerUsesMSBuildEngine(ConfiguredProject, out byDefault, out require); if (require) { return(null); } var box = new Xwt.VBox { Spacing = 6, Margin = 12 }; box.PackStart(new Xwt.Label { Markup = "<b>Build Engine</b>" }); checkMSBuild = new Xwt.CheckBox(byDefault ? GettextCatalog.GetString("Use MSBuild build engine (recommended for this project type)") : GettextCatalog.GetString("Use MSBuild build engine (unsupported for this project type)")) { Active = ConfiguredProject.UseMSBuildEngine ?? byDefault }; var hbox = new Xwt.HBox { MarginLeft = 18, Spacing = 6 }; hbox.PackStart(checkMSBuild); box.PackStart(hbox); box.Show(); return(box.ToGtkWidget()); }
public void DefaultMSBuildSupport() { DotNetAssemblyProject project = new DotNetAssemblyProject("C#"); bool byDefault, require; MSBuildProjectService.CheckHandlerUsesMSBuildEngine(project, out byDefault, out require); Assert.IsTrue(byDefault); Assert.IsFalse(require); }
public void DefaultMSBuildSupportForNewProject() { var project = Services.ProjectService.CreateDotNetProject("C#"); bool byDefault, require; MSBuildProjectService.CheckHandlerUsesMSBuildEngine(project, out byDefault, out require); Assert.IsTrue(byDefault); Assert.IsFalse(require); project.Dispose(); }
public void Store() { if (projectNameEntry.Text != project.Name) { ProjectOptionsDialog.RenameItem(project, projectNameEntry.Text); if (project.ParentSolution != null) { dialog.ModifiedObjects.Add(project.ParentSolution); } } project.Description = projectDescriptionTextView.Buffer.Text; if (project is DotNetProject) { ((DotNetProject)project).DefaultNamespace = projectDefaultNamespaceEntry.Text; bool byDefault, require; MSBuildProjectService.CheckHandlerUsesMSBuildEngine(project, out byDefault, out require); if (!require) { var active = msbuildCheck.Active; if (active == byDefault) { project.UseMSBuildEngine = null; } else { project.UseMSBuildEngine = active; } } } if (newFilesOnLoadCheckButton.Active) { project.NewFileSearch = autoInsertNewFilesCheckButton.Active ? NewFileSearch.OnLoadAutoInsert : NewFileSearch.OnLoad; } else { project.NewFileSearch = NewFileSearch.None; } if (checkSolutionVersion.Active) { project.SyncVersionWithSolution = true; } else { project.SyncVersionWithSolution = false; project.Version = entryVersion.Text; } }
public override void ApplyChanges() { bool byDefault, require; MSBuildProjectService.CheckHandlerUsesMSBuildEngine(ConfiguredProject, out byDefault, out require); if (!require) { var active = checkMSBuild.Active; if (active == byDefault) { ConfiguredProject.UseMSBuildEngine = null; } else { ConfiguredProject.UseMSBuildEngine = active; } } }
public GeneralProjectOptionsWidget(Project project, OptionsDialog dialog) { Build(); this.project = project; this.dialog = dialog; nameLabel.UseUnderline = true; descriptionLabel.UseUnderline = true; projectNameEntry.Text = project.Name; projectDescriptionTextView.Buffer.Text = project.Description; // TODO msbuild Move to build panel? if (project is DotNetProject) { projectDefaultNamespaceEntry.Text = ((DotNetProject)project).DefaultNamespace; bool byDefault, require; MSBuildProjectService.CheckHandlerUsesMSBuildEngine(project, out byDefault, out require); if (require) { this.msbuildOptionsSection.Visible = false; this.msbuildHeaderLabel.Visible = false; } else { this.msbuildCheck.Active = project.UseMSBuildEngine ?? byDefault; if (byDefault) { msbuildCheck.Label = GettextCatalog.GetString("Use MSBuild build engine (recommended for this project type)"); } else { msbuildCheck.Label = GettextCatalog.GetString("Use MSBuild build engine (unsupported for this project type)"); } } } else { defaultNamespaceLabel.Visible = false; projectDefaultNamespaceEntry.Visible = false; this.msbuildOptionsSection.Visible = false; this.msbuildHeaderLabel.Visible = false; } switch (project.NewFileSearch) { case NewFileSearch.None: newFilesOnLoadCheckButton.Active = false; autoInsertNewFilesCheckButton.Active = false; break; case NewFileSearch.OnLoad: newFilesOnLoadCheckButton.Active = true; autoInsertNewFilesCheckButton.Active = false; break; default: newFilesOnLoadCheckButton.Active = true; autoInsertNewFilesCheckButton.Active = true; break; } entryVersion.Text = project.Version; checkSolutionVersion.Active = project.SyncVersionWithSolution; entryVersion.Sensitive = !project.SyncVersionWithSolution; newFilesOnLoadCheckButton.Clicked += new EventHandler(AutoLoadCheckBoxCheckedChangeEvent); AutoLoadCheckBoxCheckedChangeEvent(null, null); }