示例#1
0
        private void readConfig()
        {
            string path = Assembly.GetExecutingAssembly().Location;

            path = path.Substring(0, path.LastIndexOf('\\')) + @"\config.ini";
            INIClass ini            = new INIClass(path);
            bool     autoSyncCircle = ini.IniReadValue("AUTOSYNC", "autoSyncCircle", "0") == "1";

            autoSyncOnStart = ini.IniReadValue("AUTOSYNC", "autoSyncOnStart", "0") == "1";
            decimal autoSyncInterval = int.Parse(ini.IniReadValue("AUTOSYNC", "interval", "5"));

            this.autoSyncInterval = autoSyncInterval;
            this.autoSyncCircle   = autoSyncCircle;
        }
示例#2
0
        private CONFIG getConfig()
        {
            CONFIG config;

            config.autoStart       = getAutoStartStatus();
            config.exitConfirm     = ini.IniReadValue("EXIT", "exitConfirm", "1") == "1";
            config.autoSyncOnStart = ini.IniReadValue("AUTOSYNC", "autoSyncOnStart", "0") == "1";
            config.autoSyncCircle  = ini.IniReadValue("AUTOSYNC", "autoSyncCircle", "0") == "1";
            decimal interval = int.Parse(ini.IniReadValue("AUTOSYNC", "interval", "5"));
            decimal max      = numericUpDown1.Maximum;
            decimal min      = numericUpDown1.Minimum;

            interval        = interval > max ? max : interval;
            interval        = interval < min ? min : interval;
            config.interval = interval;
            return(config);
        }
示例#3
0
        private void ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            string path = Assembly.GetExecutingAssembly().Location;

            path = path.Substring(0, path.LastIndexOf('\\')) + @"\config.ini";
            INIClass ini     = new INIClass(path);
            bool     confirm = true;

            if (ini.ExistINIFile())
            {
                confirm = ini.IniReadValue("EXIT", "exitConfirm", "1") == "1";
            }
            if (confirm)
            {
                Form3.Open(this);
            }
            else
            {
                Dispose();
                Close();
                Application.Exit();
            }
        }