/// <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); } }
public override void Load() { VersioningStyle versioningStyle = new VersioningStyle(); versioningStyle.FromGlobalVariable(string.Concat(new string[] { GlobalAddinSettings.Default.GlobalMajor, ".", GlobalAddinSettings.Default.GlobalMinor, ".", GlobalAddinSettings.Default.GlobalBuild, ".", GlobalAddinSettings.Default.GlobalRevision })); base.VersioningStyle = versioningStyle; base.BuildAction = (BuildActionType)Enum.Parse(typeof(BuildActionType), GlobalAddinSettings.Default.GlobalBuildAction); base.AutoUpdateAssemblyVersion = GlobalAddinSettings.Default.GlobalAutoUpdateAssemblyVersion; base.AutoUpdateFileVersion = GlobalAddinSettings.Default.GlobalAutoUpdateFileVersion; base.ReplaceNonNumerics = GlobalAddinSettings.Default.GlobalReplaceNonNumeric; base.IsUniversalTime = GlobalAddinSettings.Default.GlobalUseUniversalClock; base.IncrementBeforeBuild = GlobalAddinSettings.Default.GlobalIncrementBeforeBuild; base.StartDate = GlobalAddinSettings.Default.GlobalStartDate; base.DetectChanges = GlobalAddinSettings.Default.DetectChanges; this.Apply = (GlobalIncrementSettings.ApplyGlobalSettings)Enum.Parse(typeof(GlobalIncrementSettings.ApplyGlobalSettings), GlobalAddinSettings.Default.GlobalApply); }
/// <summary> /// Resets the settings to the defaults /// </summary> public override void Reset() { string versioningStyle = VersioningStyle.GetDefaultGlobalVariable(); VersioningStyle.FromGlobalVariable(versioningStyle); AutoUpdateAssemblyVersion = false; AutoUpdateFileVersion = false; BuildAction = BuildActionType.Both; StartDate = new DateTime(1975, 10, 21); ReplaceNonNumerics = true; IncrementBeforeBuild = true; AssemblyInfoFilename = String.Empty; ConfigurationName = "Any"; UseGlobalSettings = false; IsUniversalTime = false; DetectChanges = true; }
/// <summary> /// Resets the settings to it's defaults. /// </summary> public override void Reset() { AutoUpdateAssemblyVersion = false; AutoUpdateFileVersion = false; BuildAction = BuildActionType.Both; string versioningStyle = VersioningStyle.GetDefaultGlobalVariable(); VersioningStyle.FromGlobalVariable(versioningStyle); IsUniversalTime = false; StartDate = new DateTime(1975, 10, 21); ReplaceNonNumerics = true; IncrementBeforeBuild = true; DetectChanges = true; Apply = ApplyGlobalSettings.OnlyWhenChosen; }
/// <summary> /// Loads the settings into this instance. /// </summary> public override void Load() { // set the increment style VersioningStyle vs = new VersioningStyle(); vs.FromGlobalVariable(GlobalAddinSettings.Default.GlobalMajor + "." + GlobalAddinSettings.Default.GlobalMinor + "." + GlobalAddinSettings.Default.GlobalBuild + "." + GlobalAddinSettings.Default.GlobalRevision); this.VersioningStyle = vs; // get the rest BuildAction = (BuildActionType)Enum.Parse(typeof(BuildActionType), GlobalAddinSettings.Default.GlobalBuildAction); AutoUpdateAssemblyVersion = GlobalAddinSettings.Default.GlobalAutoUpdateAssemblyVersion; AutoUpdateFileVersion = GlobalAddinSettings.Default.GlobalAutoUpdateFileVersion; ReplaceNonNumerics = GlobalAddinSettings.Default.GlobalReplaceNonNumeric; IsUniversalTime = GlobalAddinSettings.Default.GlobalUseUniversalClock; IncrementBeforeBuild = GlobalAddinSettings.Default.GlobalIncrementBeforeBuild; StartDate = GlobalAddinSettings.Default.GlobalStartDate; /* ?? No idea why this was done by parsing * * DateTime parsedValue = new DateTime(1975, 10, 21); * * try * { * parsedValue = DateTime.ParseExact(GlobalAddinSettings.Default.GlobalStartDate, "yyyy/MM/dd", null, System.Globalization.DateTimeStyles.None); * } * catch (Exception ex) * { * Logger.Write("Error occured while parsing the global start date \"" + GlobalAddinSettings.Default.GlobalStartDate + "\".\r\n" + ex.ToString(), LogLevel.Error); * } * * StartDate = parsedValue;*/ DetectChanges = GlobalAddinSettings.Default.DetectChanges; Apply = (ApplyGlobalSettings)Enum.Parse(typeof(ApplyGlobalSettings), GlobalAddinSettings.Default.GlobalApply); }