public override void Load() { MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(Project, Helper.Configuration, Helper.Platform); setControlValue(control, group.GetElementMetadata(elementName, metadataName)); }
public override bool Save() { MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(Project, Helper.Configuration, Helper.Platform); string controlValue = getControlValue(control); group.SetElementMetadata(elementName, metadataName, controlValue); return(true); }
void SetOutputTypeCombo() { MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(base.Project, base.Project.ActiveConfiguration); string subsystem = group.GetElementMetadata("Link", "SubSystem"); string configurationType = base.Project.GetEvaluatedProperty("ConfigurationType"); OutputType validOutputType = ConfigurationTypeToOutputType(configurationType, subsystem); this.outputTypeComboBox.SelectedIndex = Array.IndexOf((OutputType[])Enum.GetValues(typeof(OutputType)), validOutputType); }
/// <summary> /// Applies the OutputType property value from combo box control to the vcxproj project. /// <para>The OutputType property is translated to ConfigurationType and Subsystem properties</para> /// </summary> /// <returns>the ConfigurationType associated to OutputType</returns> string ConvertOutputType() { OutputType[] values = (OutputType[])Enum.GetValues(typeof(OutputType)); OutputType outputType = values[this.outputTypeComboBox.SelectedIndex]; string subsystem = OutputTypeToSubsystem(outputType); MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(base.Project, base.Project.ActiveConfiguration); group.SetElementMetadata("Link", "SubSystem", subsystem); return(OutputTypeToConfigurationType(outputType)); }
/// <summary> /// Applies the OutputType property value from combo box control to the vcxproj project. /// <para>The OutputType property is translated to ConfigurationType and Subsystem properties</para> /// </summary> /// <returns>the ConfigurationType associated to OutputType</returns> string ConvertOutputType(ComboBox cbOutputType) { OutputType[] values = (OutputType[])Enum.GetValues(typeof(OutputType)); OutputType outputType = values[cbOutputType.SelectedIndex]; string subsystem = OutputTypeToSubsystem(outputType); MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project, helper.Configuration, helper.Platform); group.SetElementMetadata("Link", "SubSystem", subsystem); return(OutputTypeToConfigurationType(outputType)); }
protected override bool Save(MSBuildBasedProject project, string configuration, string platform) { MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project, project.ActiveConfiguration); SetElementMetaData(group, "PreprocessorDefinitions", this.defineTextBox.Text); SetElementMetaData(group, "UndefinePreprocessorDefinitions", this.undefineTextBox.Text); string check = "false"; if ((bool)this.undefineAllCheckBox.IsChecked) { check = "true"; } SetElementMetaData(group, "UndefineAllPreprocessorDefinitions", check); return(base.Save(project, configuration, platform)); }
protected override void Initialize() { MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(base.Project, base.Project.ActiveConfiguration); this.defineTextBox.Text = GetElementMetaData(group, "PreprocessorDefinitions"); this.undefineTextBox.Text = GetElementMetaData(group, "UndefinePreprocessorDefinitions"); string defs = GetElementMetaData(group, "UndefineAllPreprocessorDefinitions"); bool check; if (bool.TryParse(defs, out check)) { this.CheckBoxChecked = check; this.undefineAllCheckBox.IsChecked = check; } IsDirty = false; }
protected override bool Save(MSBuildBasedProject project, string configuration, string platform) { MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project, project.ActiveConfiguration); SetElementMetaData(group, "AdditionalDependencies", this.additionalLibsTextBox.Text); SetElementMetaData(group, "AddModuleNamesToAssembly", this.addModuleTextBox.Text); SetElementMetaData(group, "EmbedManagedResourceFile", this.resourceFileTextBox.Text); SetElementMetaData(group, "AdditionalOptions", this.additionalOptionsTextBox.Text); string check = "false"; if ((bool)this.debugInfoCheckBox.IsChecked) { check = "true"; } SetElementMetaData(group, "GenerateDebugInformation", check); return(base.Save(project, configuration, platform)); }
protected override void Initialize() { var msDefGroup = new MSBuildItemDefinitionGroup(base.Project, base.Project.ActiveConfiguration); this.additionalLibsTextBox.Text = GetElementMetaData(msDefGroup, "AdditionalDependencies"); this.addModuleTextBox.Text = GetElementMetaData(msDefGroup, "AddModuleNamesToAssembly"); this.resourceFileTextBox.Text = GetElementMetaData(msDefGroup, "EmbedManagedResourceFile"); this.additionalOptionsTextBox.Text = GetElementMetaData(msDefGroup, "AdditionalOptions"); string def = GetElementMetaData(msDefGroup, "GenerateDebugInformation"); bool check; if (bool.TryParse(def, out check)) { this.CheckBoxChecked = check; this.debugInfoCheckBox.IsChecked = check; } IsDirty = false; }
public override void LoadPanelContents() { base.LoadPanelContents(); ComboBox cbOutputType = Get <ComboBox>("outputType"); helper.AddBinding("ConfigurationType", new ObservedBinding <string, ComboBox>(cbOutputType, ConvertOutputType)); MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project, helper.Configuration, helper.Platform); string subsystem = group.GetElementMetadata("Link", "SubSystem"); string configurationType = project.GetEvaluatedProperty("ConfigurationType"); OutputType validOutputType = ConfigurationTypeToOutputType(configurationType, subsystem); cbOutputType.SelectedIndex = Array.IndexOf((OutputType[])Enum.GetValues(typeof(OutputType)), validOutputType); TextBox tbApplicationIcon = Get <TextBox>("applicationIcon"); helper.AddBinding(null, new ObservedBinding <object, TextBox>(tbApplicationIcon, SetApplicationIcon)); tbApplicationIcon.Text = GetApplicationIconPathFromResourceScripts(); DisableWin32ResourceOptions(); IsDirty = false; }
private static string GetElementMetaData(MSBuildItemDefinitionGroup group, string name) { return(group.GetElementMetadata(metaElement, name)); }
private static void SetElementMetaData(MSBuildItemDefinitionGroup group, string name, string value) { group.SetElementMetadata(metaElement, name, value); }
private static void SpecifyRuntimeLibrary(MSBuildBasedProject project, string configuration, string runtime) { MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project, new ConfigurationAndPlatform(configuration, null)); group.SetElementMetadata("ClCompile", "RuntimeLibrary", runtime); }