/// <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");
        }
 /// <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);
     }
 }
コード例 #3
0
        public override void Reset()
        {
            base.AutoUpdateAssemblyVersion = false;
            base.AutoUpdateFileVersion     = false;
            base.BuildAction = BuildActionType.Both;
            string defaultGlobalVariable = VersioningStyle.GetDefaultGlobalVariable();

            base.VersioningStyle.FromGlobalVariable(defaultGlobalVariable);
            base.IsUniversalTime      = false;
            base.StartDate            = new DateTime(1975, 10, 21);
            base.ReplaceNonNumerics   = true;
            base.IncrementBeforeBuild = true;
            base.DetectChanges        = true;
            this.Apply = GlobalIncrementSettings.ApplyGlobalSettings.OnlyWhenChosen;
        }
        /// <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;
        }
コード例 #5
0
        public override void Reset()
        {
            string defaultGlobalVariable = VersioningStyle.GetDefaultGlobalVariable();

            base.VersioningStyle.FromGlobalVariable(defaultGlobalVariable);
            base.AutoUpdateAssemblyVersion = false;
            base.AutoUpdateFileVersion     = false;
            base.BuildAction          = BuildActionType.Both;
            base.StartDate            = new DateTime(1975, 10, 21);
            base.ReplaceNonNumerics   = true;
            base.IncrementBeforeBuild = true;
            this.AssemblyInfoFilename = string.Empty;
            this.ConfigurationName    = "Any";
            this.UseGlobalSettings    = false;
            base.IsUniversalTime      = false;
            base.DetectChanges        = true;
        }
コード例 #6
0
        /// <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;
        }