示例#1
0
        /// <summary>
        /// Saves the current settings stored in the internal dictionary
        /// </summary>
        public void Save()
        {
            // Update the dictionary from the public properties
            this["AltSequence"]           = AltSequence;
            this["BazaarPath"]            = BazaarPath;
            this["BranchLocation"]        = BranchLocation;
            this["DbBuildConfigurations"] = DbBuildConfigurations;
            this["LaunchpadUserName"]     = LaunchpadUserName;
            this["Sequence"]            = Sequence;
            this["UncrustifyPath"]      = UncrustifyPath;
            this["WindowPosition"]      = WindowPosition;
            this["YAMLLocationHistory"] = YAMLLocationHistory;

            this["CodeGenerationComboID"] = CodeGenerationComboID.ToString();
            this["CompilationComboID"]    = CompilationComboID.ToString();
            this["MiscellaneousComboID"]  = MiscellaneousComboID.ToString();
            this["SourceCodeComboID"]     = SourceCodeComboID.ToString();
            this["DatabaseComboID"]       = DatabaseComboID.ToString();
            this["FlashAfterSeconds"]     = FlashAfterSeconds.ToString();

            this["NBA_GenerateSolutionOption"] = NBA_GenerateSolutionOption.ToString();
            this["NBA_CreateMyConfigurations"] = NBA_CreateMyConfigurations ? "1" : "0";
            this["NBA_InitialiseDatabase"]     = NBA_InitialiseDatabase ? "1" : "0";
            this["NBA_DatabaseConfiguration"]  = NBA_DatabaseConfiguration.ToString();
            this["NBA_LaunchIDE"]   = NBA_LaunchIDE ? "1" : "0";
            this["NBA_IDESolution"] = NBA_IDESolution.ToString();
            this["NBA_StartClient"] = NBA_StartClient ? "1" : "0";

            this["EBA_GenerateSolutionOption"] = EBA_GenerateSolutionOption.ToString();
            this["EBA_CreateMyConfigurations"] = EBA_CreateMyConfigurations ? "1" : "0";
            this["EBA_InitialiseDatabase"]     = EBA_InitialiseDatabase ? "1" : "0";
            this["EBA_DatabaseConfiguration"]  = EBA_DatabaseConfiguration.ToString();
            this["EBA_LaunchIDE"]   = EBA_LaunchIDE ? "1" : "0";
            this["EBA_IDESolution"] = EBA_IDESolution.ToString();
            this["EBA_StartClient"] = EBA_StartClient ? "1" : "0";

            this["AutoStartServer"]                = AutoStartServer ? "1" : "0";
            this["AutoStopServer"]                 = AutoStopServer ? "1" : "0";
            this["MinimiseServerAtStartup"]        = MinimiseServerAtStartup ? "1" : "0";
            this["TreatWarningsAsErrors"]          = TreatWarningsAsErrors ? "1" : "0";
            this["DoPreBuildOnIctCommon"]          = DoPreBuildOnIctCommon ? "1" : "0";
            this["DoPostBuildOnPetraClient"]       = DoPostBuildOnPetraClient ? "1" : "0";
            this["CompileWinForm"]                 = CompileWinForm ? "1" : "0";
            this["StartClientAfterCompileWinForm"] = StartClientAfterCompileWinForm ? "1" : "0";
            this["AutoCheckForUpdates"]            = AutoCheckForUpdates ? "1" : "0";

            // Add our appVersion key/value
            if (!this.ContainsKey("ApplicationVersion"))
            {
                this.Add("ApplicationVersion", _applicationVersion);
            }
            else
            {
                this["ApplicationVersion"] = _applicationVersion;
            }

            // Now do the low-level save of the file
            base.Save(_path, ContentHeader);
        }
        /// <summary>
        /// Main Constructor
        /// </summary>
        /// <param name="path">Full path to the local settings file that will be read and written</param>
        /// <param name="ApplicationVersion">The version of the application hosting this file, eg 1.0.0.100</param>
        public SettingsDictionary(string path, string ApplicationVersion)
        {
            _path = path;
            _applicationVersion = ApplicationVersion;

            // Initialise all default values of our public properties in the constructor
            AltSequence           = String.Empty;
            BazaarPath            = String.Empty;
            BranchLocation        = String.Empty;
            DbBuildConfigurations = String.Empty;
            Sequence     = String.Empty;
            YAMLLocation = String.Empty;

            CodeGenerationComboID = 2;
            CompilationComboID    = 2;
            DatabaseComboID       = 1;
            FlashAfterSeconds     = 15;
            MiscellaneousComboID  = 0;

            AutoStartServer                = true;
            AutoStopServer                 = true;
            MinimiseServerAtStartup        = true;
            TreatWarningsAsErrors          = true;
            DoPreBuildOnIctCommon          = false;
            DoPostBuildOnPetraClient       = false;
            CompileWinForm                 = true;
            StartClientAfterCompileWinForm = true;
            AutoCheckForUpdates            = true;

            // Add items to our dictionary
            this.Add("AltSequence", AltSequence);
            this.Add("BazaarPath", BazaarPath);
            this.Add("BranchLocation", BranchLocation);
            this.Add("DbBuildConfigurations", DbBuildConfigurations);
            this.Add("Sequence", Sequence);
            this.Add("YAMLLocation", YAMLLocation);

            this.Add("CodeGenerationComboID", CodeGenerationComboID.ToString());
            this.Add("CompilationComboID", CompilationComboID.ToString());
            this.Add("DatabaseComboID", DatabaseComboID.ToString());
            this.Add("FlashAfterSeconds", FlashAfterSeconds.ToString());
            this.Add("MiscellaneousComboID", MiscellaneousComboID.ToString());

            this.Add("AutoStartServer", AutoStartServer ? "1" : "0");
            this.Add("AutoStopServer", AutoStopServer ? "1" : "0");
            this.Add("MinimiseServerAtStartup", MinimiseServerAtStartup ? "1" : "0");
            this.Add("TreatWarningsAsErrors", TreatWarningsAsErrors ? "1" : "0");
            this.Add("DoPreBuildOnIctCommon", DoPreBuildOnIctCommon ? "1" : "0");
            this.Add("DoPostBuildOnPetraClient", DoPostBuildOnPetraClient ? "1" : "0");
            this.Add("CompileWinForm", CompileWinForm ? "1" : "0");
            this.Add("StartClientAfterCompileWinForm", StartClientAfterCompileWinForm ? "1" : "0");
            this.Add("AutoCheckForUpdates", AutoCheckForUpdates ? "1" : "0");
        }
示例#3
0
        /// <summary>
        /// Main Constructor
        /// </summary>
        /// <param name="path">Full path to the local settings file that will be read and written</param>
        /// <param name="ApplicationVersion">The version of the application hosting this file, eg 1.0.0.100</param>
        public SettingsDictionary(string path, string ApplicationVersion)
        {
            _path = path;
            _applicationVersion = ApplicationVersion;

            // Initialise all default values of our public properties in the constructor
            AltSequence           = String.Empty;
            BazaarPath            = String.Empty;
            BranchLocation        = String.Empty;
            DbBuildConfigurations = String.Empty;
            LaunchpadUserName     = String.Empty;
            Sequence            = String.Empty;
            UncrustifyPath      = "ICT";
            WindowPosition      = String.Empty;
            YAMLLocationHistory = String.Empty;

            CodeGenerationComboID = 2;
            CompilationComboID    = 2;
            MiscellaneousComboID  = 0;
            SourceCodeComboID     = 13;
            DatabaseComboID       = 1;
            FlashAfterSeconds     = 15;

            NBA_GenerateSolutionOption = 1;
            NBA_CreateMyConfigurations = true;
            NBA_InitialiseDatabase     = true;
            NBA_DatabaseConfiguration  = 0;
            NBA_LaunchIDE   = true;
            NBA_IDESolution = 0;
            NBA_StartClient = true;

            EBA_GenerateSolutionOption = 0;
            EBA_CreateMyConfigurations = false;
            EBA_InitialiseDatabase     = true;
            EBA_DatabaseConfiguration  = 0;
            EBA_LaunchIDE   = true;
            EBA_IDESolution = 0;
            EBA_StartClient = true;

            AutoStartServer                = true;
            AutoStopServer                 = true;
            MinimiseServerAtStartup        = true;
            TreatWarningsAsErrors          = true;
            DoPreBuildOnIctCommon          = false;
            DoPostBuildOnPetraClient       = false;
            CompileWinForm                 = true;
            StartClientAfterCompileWinForm = true;
            AutoCheckForUpdates            = true;

            // Add items to our dictionary
            this.Add("AltSequence", AltSequence);
            this.Add("BazaarPath", BazaarPath);
            this.Add("BranchLocation", BranchLocation);
            this.Add("DbBuildConfigurations", DbBuildConfigurations);
            this.Add("LaunchpadUserName", LaunchpadUserName);
            this.Add("Sequence", Sequence);
            this.Add("UncrustifyPath", UncrustifyPath);
            this.Add("WindowPosition", WindowPosition);
            this.Add("YAMLLocationHistory", YAMLLocationHistory);

            this.Add("CodeGenerationComboID", CodeGenerationComboID.ToString());
            this.Add("CompilationComboID", CompilationComboID.ToString());
            this.Add("MiscellaneousComboID", MiscellaneousComboID.ToString());
            this.Add("SourceCodeComboID", SourceCodeComboID.ToString());
            this.Add("DatabaseComboID", DatabaseComboID.ToString());
            this.Add("FlashAfterSeconds", FlashAfterSeconds.ToString());

            this.Add("NBA_GenerateSolutionOption", NBA_GenerateSolutionOption.ToString());
            this.Add("NBA_CreateMyConfigurations", NBA_CreateMyConfigurations ? "1" : "0");
            this.Add("NBA_InitialiseDatabase", NBA_InitialiseDatabase ? "1" : "0");
            this.Add("NBA_DatabaseConfiguration", NBA_DatabaseConfiguration.ToString());
            this.Add("NBA_LaunchIDE", NBA_LaunchIDE ? "1" : "0");
            this.Add("NBA_IDESolution", NBA_IDESolution.ToString());
            this.Add("NBA_StartClient", NBA_StartClient ? "1" : "0");

            this.Add("EBA_GenerateSolutionOption", EBA_GenerateSolutionOption.ToString());
            this.Add("EBA_CreateMyConfigurations", EBA_CreateMyConfigurations ? "1" : "0");
            this.Add("EBA_InitialiseDatabase", EBA_InitialiseDatabase ? "1" : "0");
            this.Add("EBA_DatabaseConfiguration", EBA_DatabaseConfiguration.ToString());
            this.Add("EBA_LaunchIDE", EBA_LaunchIDE ? "1" : "0");
            this.Add("EBA_IDESolution", EBA_IDESolution.ToString());
            this.Add("EBA_StartClient", EBA_StartClient ? "1" : "0");

            this.Add("AutoStartServer", AutoStartServer ? "1" : "0");
            this.Add("AutoStopServer", AutoStopServer ? "1" : "0");
            this.Add("MinimiseServerAtStartup", MinimiseServerAtStartup ? "1" : "0");
            this.Add("TreatWarningsAsErrors", TreatWarningsAsErrors ? "1" : "0");
            this.Add("DoPreBuildOnIctCommon", DoPreBuildOnIctCommon ? "1" : "0");
            this.Add("DoPostBuildOnPetraClient", DoPostBuildOnPetraClient ? "1" : "0");
            this.Add("CompileWinForm", CompileWinForm ? "1" : "0");
            this.Add("StartClientAfterCompileWinForm", StartClientAfterCompileWinForm ? "1" : "0");
            this.Add("AutoCheckForUpdates", AutoCheckForUpdates ? "1" : "0");

            for (int i = 1; i < 10; i++)
            {
                SetBranchHistoryItem(i, String.Empty);
            }
        }