Exemplo n.º 1
0
        public void save_config()
        {
            ConfigHelper.UpdateAppConfig("FileExt", FileExt);
            ConfigHelper.UpdateAppConfig("DiffTool", DiffTool);
            ConfigHelper.UpdateAppConfig("DiffToolPath", DiffToolPath);

            ConfigHelper.UpdateAppConfig("BackupType", BackupType);
            ConfigHelper.UpdateAppConfig("BackupPath", BackupPath);


            if (folder_configData.jsonData.Count() > 0)
            {
                string ig = COptionsHelper.getFolderOptionsString(folder_configData);
                ConfigHelper.UpdateAppConfig("IgnoreFolder", ig);
            }

            if (file_configData.jsonData.Count() > 0)
            {
                string ig = COptionsHelper.getFileOptionsString(file_configData);
                ConfigHelper.UpdateAppConfig("IgnoreFile", ig);
            }

            if (comment_regexConfig.jsonData.Count() > 0)
            {
                string ig = COptionsHelper.getRegexOptionsString(comment_regexConfig);
                ConfigHelper.UpdateAppConfig("Comment_Regex", ig);
            }

            if (comment_findConfig.jsonData.Count() > 0)
            {
                string ig = COptionsHelper.getFileOptionsString(comment_findConfig);
                ConfigHelper.UpdateAppConfig("Comment_Find", ig);
            }
        }
Exemplo n.º 2
0
        public void load_config()
        {
            FileExt      = ConfigHelper.GetAppConfig("FileExt", "*.c;*.cpp;*.h;*.java;*.php;*.asp;*.aspx;*.cs;*.js;*.go;*txt;*.ini;*.txt;*.py");
            DiffTool     = ConfigHelper.GetAppConfig("DiffTool", "0");
            DiffToolPath = ConfigHelper.GetAppConfig("DiffToolPath", "");

            BackupType = ConfigHelper.GetAppConfig("BackupType", "0");
            BackupPath = ConfigHelper.GetAppConfig("BackupPath", ".");

            string igfolder = ConfigHelper.GetAppConfig("IgnoreFolder", "");
            string igfile   = ConfigHelper.GetAppConfig("IgnoreFile", "");
            string regex    = ConfigHelper.GetAppConfig("Comment_Regex", "");
            string cFind    = ConfigHelper.GetAppConfig("Comment_Find", "");

            try
            {
                if ((igfolder.Length == 0) && (igfile.Length == 0) && (regex.Length == 0))
                {
                    config_inited = true;
                    reset_ignore();
                }
                else
                {
                    config_inited = true;
                }


                if (igfolder.Length > 0)
                {
                    folder_configData = COptionsHelper.getFolderOptions(igfolder);
                }

                if (igfile.Length > 0)
                {
                    file_configData = COptionsHelper.getFileOptions(igfile);
                }

                if (regex.Length > 0)
                {
                    comment_regexConfig = COptionsHelper.getRegexOptions(regex);
                }

                if (cFind.Length > 0)
                {
                    comment_findConfig = COptionsHelper.getFileOptions(cFind);
                }

                int dindex = Convert.ToInt32(DiffTool);
                if ((dindex < 0) || (dindex > 3))
                {
                    dindex = 0;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }