Example #1
0
        private bool SaveSetting()
        {
            bool ret = true;

            SettingModel sm = new SettingModel();

            try
            {
                int tc = 5;
                int.TryParse(txtThread.Text, out tc);
                var h = txtHistory.Text;
                var d = txtMangeDownload.Text;
                var z = txtZipFolder.Text;

                if (tc <= 0)
                {
                    tc = 1;
                }

                if (tc > 20)
                {
                    tc = 20;
                }

                if (!h.EndsWith("\\") && !h.EndsWith("/"))
                {
                    h += "\\";
                }

                if (!d.EndsWith("\\") && !d.EndsWith("/"))
                {
                    d += "\\";
                }

                if (!z.EndsWith("\\") && !z.EndsWith("/"))
                {
                    z += "\\";
                }

                sm.HistoryFolder = h;
                sm.MangaFolder   = d;
                sm.ZipFolder     = z;
                sm.ThreadCount   = tc;
                sm.IsZip         = cbIsZip.Checked;

                SettingSevice.WriteSetting(sm);

                MessageBox.Show("修改完目录后,如果需要继承修改前的记录,请手动复制原来目录的内容到新目录下");
            }
            catch (Exception ee)
            {
                ret = false;
                LogService.WriteLog("SaveSetting", ee.ToString());
            }

            return(ret);
        }
Example #2
0
 private void Setting_Load(object sender, EventArgs e)
 {
     settingModel = SettingSevice.ReadSetting();
     ShowSetting();
 }