public override void LoadPanelContents() { SetupFromXmlResource("ProjectOptions.ApplicationSettings.xfrm"); InitializeHelper(); ConnectBrowseButton("applicationIconBrowseButton", "applicationIconTextBox", "${res:SharpDevelop.FileFilter.Icons}|*.ico|${res:SharpDevelop.FileFilter.AllFiles}|*.*", TextBoxEditMode.EditEvaluatedProperty); ConnectBrowseButton("win32ResourceFileBrowseButton", "win32ResourceFileTextBox", "Win32 Resource files|*.res|${res:SharpDevelop.FileFilter.AllFiles}|*.*", TextBoxEditMode.EditEvaluatedProperty); ConfigurationGuiBinding b; ChooseStorageLocationButton locationButton; b = helper.BindString("assemblyNameTextBox", "AssemblyName", TextBoxEditMode.EditEvaluatedProperty); b.CreateLocationButton("assemblyNameTextBox"); Get<TextBox>("assemblyName").TextChanged += new EventHandler(RefreshOutputNameTextBox); b = helper.BindString("rootNamespaceTextBox", "RootNamespace", TextBoxEditMode.EditEvaluatedProperty); b.CreateLocationButton("rootNamespaceTextBox"); b = helper.BindEnum<OutputType>("outputTypeComboBox", "OutputType"); locationButton = b.CreateLocationButton("outputTypeComboBox"); Get<ComboBox>("outputType").SelectedIndexChanged += RefreshOutputNameTextBox; Get<ComboBox>("outputType").SelectedIndexChanged += RefreshStartupObjectEnabled; b = helper.BindString("startupObjectComboBox", "StartupObject", TextBoxEditMode.EditEvaluatedProperty); b.RegisterLocationButton(locationButton); foreach (IClass c in GetPossibleStartupObjects(project)) { Get<ComboBox>("startupObject").Items.Add(c.FullyQualifiedName); } b = helper.BindString("applicationIconTextBox", "ApplicationIcon", TextBoxEditMode.EditEvaluatedProperty); Get<TextBox>("applicationIcon").TextChanged += new EventHandler(ApplicationIconTextBoxTextChanged); b.CreateLocationButton("applicationIconTextBox"); b = helper.BindString("win32ResourceFileTextBox", "Win32Resource", TextBoxEditMode.EditEvaluatedProperty); b.CreateLocationButton("win32ResourceFileTextBox"); applicationManifestComboBox = Get<ComboBox>("applicationManifest"); applicationManifestComboBox.Items.Add(StringParser.Parse("${res:Dialog.ProjectOptions.ApplicationSettings.Manifest.EmbedDefault}")); applicationManifestComboBox.Items.Add(StringParser.Parse("${res:Dialog.ProjectOptions.ApplicationSettings.Manifest.DoNotEmbedManifest}")); foreach (string fileName in Directory.GetFiles(project.Directory, "*.manifest")) { applicationManifestComboBox.Items.Add(Path.GetFileName(fileName)); } applicationManifestComboBox.Items.Add(StringParser.Parse("<${res:Global.CreateButtonText}...>")); applicationManifestComboBox.Items.Add(StringParser.Parse("<${res:Global.BrowseText}...>")); applicationManifestComboBox.SelectedIndexChanged += ApplicationManifestComboBox_SelectedIndexChanged; b = new ManifestBinding(applicationManifestComboBox); helper.AddBinding("ApplicationManifest", b); b.CreateLocationButton(applicationManifestComboBox); applicationManifestComboBox.TextChanged += delegate { helper.IsDirty = true; }; // embedding manifests requires the project to target MSBuild 3.5 or higher // re-evaluate if the project has the minimum version whenever this options page gets visible // because the "convert project" button on the compiling tab page might have updated the MSBuild version. applicationManifestComboBox.VisibleChanged += delegate { applicationManifestComboBox.Enabled = project.MinimumSolutionVersion >= Solution.SolutionVersionVS2008; }; Get<TextBox>("projectFolder").Text = project.Directory; Get<TextBox>("projectFile").Text = Path.GetFileName(project.FileName); // maybe make this writable again? Needs special care when saving! Get<TextBox>("projectFile").ReadOnly = true; RefreshStartupObjectEnabled(null, EventArgs.Empty); RefreshOutputNameTextBox(null, EventArgs.Empty); helper.AddConfigurationSelector(this); }
public override void LoadPanelContents() { SetupFromXmlResource("ProjectOptions.ApplicationSettings.xfrm"); InitializeHelper(); ConnectBrowseButton("applicationIconBrowseButton", "applicationIconTextBox", "${res:SharpDevelop.FileFilter.Icons}|*.ico|${res:SharpDevelop.FileFilter.AllFiles}|*.*", TextBoxEditMode.EditEvaluatedProperty); ConnectBrowseButton("win32ResourceFileBrowseButton", "win32ResourceFileTextBox", "Win32 Resource files|*.res|${res:SharpDevelop.FileFilter.AllFiles}|*.*", TextBoxEditMode.EditEvaluatedProperty); ConfigurationGuiBinding b; ChooseStorageLocationButton locationButton; b = helper.BindString("assemblyNameTextBox", "AssemblyName", TextBoxEditMode.EditEvaluatedProperty); b.CreateLocationButton("assemblyNameTextBox"); Get <TextBox>("assemblyName").TextChanged += new EventHandler(RefreshOutputNameTextBox); b = helper.BindString("rootNamespaceTextBox", "RootNamespace", TextBoxEditMode.EditEvaluatedProperty); b.CreateLocationButton("rootNamespaceTextBox"); b = helper.BindEnum <OutputType>("outputTypeComboBox", "OutputType"); locationButton = b.CreateLocationButton("outputTypeComboBox"); Get <ComboBox>("outputType").SelectedIndexChanged += RefreshOutputNameTextBox; Get <ComboBox>("outputType").SelectedIndexChanged += RefreshStartupObjectEnabled; b = helper.BindString("startupObjectComboBox", "StartupObject", TextBoxEditMode.EditEvaluatedProperty); b.RegisterLocationButton(locationButton); foreach (IClass c in GetPossibleStartupObjects(project)) { Get <ComboBox>("startupObject").Items.Add(c.FullyQualifiedName); } b = helper.BindString("applicationIconTextBox", "ApplicationIcon", TextBoxEditMode.EditEvaluatedProperty); Get <TextBox>("applicationIcon").TextChanged += new EventHandler(ApplicationIconTextBoxTextChanged); b.CreateLocationButton("applicationIconTextBox"); b = helper.BindString("win32ResourceFileTextBox", "Win32Resource", TextBoxEditMode.EditEvaluatedProperty); b.CreateLocationButton("win32ResourceFileTextBox"); applicationManifestComboBox = Get <ComboBox>("applicationManifest"); applicationManifestComboBox.Items.Add(StringParser.Parse("${res:Dialog.ProjectOptions.ApplicationSettings.Manifest.EmbedDefault}")); applicationManifestComboBox.Items.Add(StringParser.Parse("${res:Dialog.ProjectOptions.ApplicationSettings.Manifest.DoNotEmbedManifest}")); foreach (string fileName in Directory.GetFiles(project.Directory, "*.manifest")) { applicationManifestComboBox.Items.Add(Path.GetFileName(fileName)); } applicationManifestComboBox.Items.Add(StringParser.Parse("<${res:Global.CreateButtonText}...>")); applicationManifestComboBox.Items.Add(StringParser.Parse("<${res:Global.BrowseText}...>")); applicationManifestComboBox.SelectedIndexChanged += ApplicationManifestComboBox_SelectedIndexChanged; b = new ManifestBinding(applicationManifestComboBox); helper.AddBinding("ApplicationManifest", b); b.CreateLocationButton(applicationManifestComboBox); applicationManifestComboBox.TextChanged += delegate { helper.IsDirty = true; }; // embedding manifests requires the project to target MSBuild 3.5 or higher // re-evaluate if the project has the minimum version whenever this options page gets visible // because the "convert project" button on the compiling tab page might have updated the MSBuild version. applicationManifestComboBox.VisibleChanged += delegate { applicationManifestComboBox.Enabled = project.MinimumSolutionVersion >= 10; }; Get <TextBox>("projectFolder").Text = project.Directory; Get <TextBox>("projectFile").Text = Path.GetFileName(project.FileName); // maybe make this writable again? Needs special care when saving! Get <TextBox>("projectFile").ReadOnly = true; RefreshStartupObjectEnabled(null, EventArgs.Empty); RefreshOutputNameTextBox(null, EventArgs.Empty); helper.AddConfigurationSelector(this); }