Exemplo n.º 1
0
        /// <summary>
        /// Creates a file with the default preferences, used by tool and user
        /// </summary>
        public void CreateDefaultConfig()
        {
            // USer : Remote folder check
            valueGnr = false;
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.skip_remote_folder], valueGnr.ToString().ToLower(), userconf_filepath);
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.skip_remote_tool_folder], valueGnr.ToString(), userconf_filepath);

            // User : Always on options
            valueGnr = true;
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.always_flash], valueGnr.ToString().ToLower(), userconf_filepath);
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.always_ask_to_save], valueGnr.ToString(), userconf_filepath);

            // User : default folder options
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.default_save_folder], Environment.GetFolderPath(Environment.SpecialFolder.Desktop).ToLower(), userconf_filepath);
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.default_working_folder], default_work_folder.ToLower(), userconf_filepath);

            // User : Current work folder options
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.active_working_folder], default_work_folder.ToLower(), userconf_filepath);
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.active_save_folder], Environment.GetFolderPath(Environment.SpecialFolder.Desktop).ToLower(), userconf_filepath);

            // User  :Flash tool options
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.default_flash_tool], flash_tool_names[(int)FlashToolSelection.Dediprog].ToLower(), userconf_filepath);

            // Tool : default remote paths
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.tool], MainOptionSText[(int)ToolConfOptions.default_flashfolders_path], def_flashfolder_path.ToLower(), userconf_filepath);
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.tool], MainOptionSText[(int)ToolConfOptions.default_common_tool_path], def_flashfolder_cmm_path.ToLower(), userconf_filepath);
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.tool], MainOptionSText[(int)ToolConfOptions.default_ssf_path], def_ssf_path.ToLower(), userconf_filepath);

            OptMeessage = "Default config file was created";
        }
Exemplo n.º 2
0
        /// <summary>
        /// Saves all parameters from UI to a file
        /// </summary>
        public void SaveConfiguration()
        {
            // Remote folder check
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.skip_remote_folder], options.skip_remote_folder_check.ToString().ToLower(), userconf_filepath);
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.skip_remote_tool_folder], options.skip_remote_folder_tools.ToString().ToLower(), userconf_filepath);

            // Always on options
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.always_flash], options.always_auto_flash.ToString().ToLower(), userconf_filepath);
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.always_ask_to_save], options.always_ask_save.ToString().ToLower(), userconf_filepath);

            // default folder options
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.default_save_folder], options.default_save_folder_path.ToLower(), userconf_filepath);
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.default_working_folder], options.default_working_folder_path.ToLower(), userconf_filepath);

            // Current work folder options
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.active_working_folder], options.active_working_folder_path.ToLower(), userconf_filepath);
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.active_save_folder], options.active_save_folder_path.ToLower(), userconf_filepath);

            // Flash tool options
            IniFileHelper.WriteValue(ConfigSectionsText[(int)ConfigSections.user], MainOptionSText[(int)ToolConfOptions.default_flash_tool], flash_tool_names[options.default_flash_tool].ToLower(), userconf_filepath);

            OptMeessage = "Configuration was saved";
        }