コード例 #1
0
        public static bool ReadDatFile(IniParser parser)//read success bool returned
        {
            bool success = false;

            bool readremote = true;

            try
            {
                //read remoteb
                string   remotearray = parser.getDatFromKey(mainsec, curremotepre, out readremote);
                string[] rarr        = remotearray.Split(',');
                curRemote.Clear();
                //check to make sure there are no spaces on any of those
                for (int i = 0; i < rarr.Length; i++)
                {
                    if (rarr[i].Contains(" "))
                    {
                        rarr[i] = StringFilter.RemoveSpace(rarr[i]);
                    }
                    curRemote.Add(rarr[i]);
                }
                //now no white spaces
            }
            catch
            {
                readremote = false;
            }
            if (readremote)
            {
                success = true;
            }
            else
            {
                return(false);
            }

            bool readversion = true;

            try
            {
                string versionfile = parser.getDatFromKey(mainsec, versionpre, out readversion);
                string curVersion  = VersionController.WriteVersionNoOnly();
                if (versionfile != curVersion)
                {
                    UI.giveWarning("Different version used in saved config data");
                }
            }
            catch
            {
                readversion = false;
            }
            if (readversion)
            {
                success = true;
            }
            else
            {
                return(false);
            }
            //got this far exit with a yay
            return(success);
        }
コード例 #2
0
 public static void SaveConfig()
 {
     parser.SetKey(mainsec, versionpre, VersionController.WriteVersionNoOnly());
     parser.SetKey(mainsec, curremotepre, getRemotesString(false));
     parser.Save();
 }