/// <summary> /// Saves the settings of this instance. /// </summary> public override void Save() { GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_buildVersioningStyle, VersioningStyle.ToGlobalVariable(), VersioningStyle.GetDefaultGlobalVariable()); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_updateAssemblyVersion, AutoUpdateAssemblyVersion.ToString(), "false"); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_updateFileVersion, AutoUpdateFileVersion.ToString(), "false"); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_buildAction, BuildAction.ToString(), "Both"); string startDate = string.Format("{0}/{1}/{2}", StartDate.Year, StartDate.Month, StartDate.Day); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_startDate, startDate, "1975/10/21"); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_replaceNonNumerics, ReplaceNonNumerics.ToString(), "true"); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_incrementBeforeBuild, IncrementBeforeBuild.ToString(), "true"); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_assemblyInfoFilename, AssemblyInfoFilename, ""); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_configurationName, ConfigurationName, "Any"); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_useGlobalSettings, UseGlobalSettings.ToString(), "false"); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_useUniversalClock, IsUniversalTime.ToString(), "false"); GlobalVariables.SetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_detectChanges, DetectChanges.ToString(), "true"); }
public static void SetGlobalVariable(Globals globals, string variableName, string value, string defaultValue) { if (globals != null) { string globalVariable = GlobalVariables.GetGlobalVariable(globals, variableName, null); if (globalVariable != null) { if (string.Compare(globalVariable, value, true) != 0) { GlobalVariables.SetGlobalVariable(globals, variableName, value); } } else { if (string.Compare(value, defaultValue, true) != 0) { GlobalVariables.SetGlobalVariable(globals, variableName, value); } } } }
public void SetGlobalVariable(string varName, string value) { GlobalVariables.SetGlobalVariable(this.Globals, varName, value); }