public void SetGlobalVariable(string varName, string value) { GlobalVariables.SetGlobalVariable(this.Globals, varName, value); }
/// <summary> /// Loads the settings into this instance. /// </summary> public override void Load() { try { string versioningStyle = GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_buildVersioningStyle, VersioningStyle.GetDefaultGlobalVariable()); VersioningStyle.FromGlobalVariable(versioningStyle); AutoUpdateAssemblyVersion = bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_updateAssemblyVersion, "false")); AutoUpdateFileVersion = bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_updateFileVersion, "false")); try { BuildAction = (BuildActionType)Enum.Parse(typeof(BuildActionType), GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_buildAction, "Both")); } catch (ArgumentException) { BuildAction = BuildActionType.Both; } StartDate = DateTime.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_startDate, "1975/10/21")); ReplaceNonNumerics = bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_replaceNonNumerics, "true")); IncrementBeforeBuild = bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_incrementBeforeBuild, "true")); AssemblyInfoFilename = GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_assemblyInfoFilename, ""); ConfigurationName = GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_configurationName, "Any"); UseGlobalSettings = bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_useGlobalSettings, (GlobalIncrementSettings.ApplySettings == GlobalIncrementSettings.ApplyGlobalSettings.AsDefault).ToString())); IsUniversalTime = bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_useUniversalClock, "false")); DetectChanges = bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals, Resources.GlobalVarName_detectChanges, "true")); } catch (Exception ex) { Logger.Write("Error occured while reading BuildVersionIncrement settings from \"" + SolutionItem.Filename + "\"\n" + ex.ToString(), LogLevel.Error); } }
private string GetGlobalVariable(string varName, string defaultValue) { return(GlobalVariables.GetGlobalVariable(this.Globals, varName, defaultValue)); }