/// <summary> /// 获取文件 /// </summary> /// <returns></returns> public static RegConfigInfo GetConfig() { if (_configFileManager == null) { _configFileManager = new ConfigFileManager <RegConfigInfo>("/config/reg.config"); } return(_configFileManager.LoadConfig()); }
/// <summary> /// 获取文件 /// </summary> /// <returns></returns> public static SerializableStringDictionary GetConfig() { if (_configFileManager == null) { _configFileManager = new ConfigFileManager <SerializableStringDictionary>("/config/global.config"); } return(_configFileManager.LoadConfig()); }
private void button_0_Click(object sender, EventArgs e) { this.ruleConfigInfo_0 = (RuleConfigInfo)ConfigFileManager.LoadConfig(this.comboBox_0.Text, this.ruleConfigInfo_0); this.propertyInfo_0 = this.ruleConfigInfo_0.GetType().GetProperties(); for (int i = 0; i < (int)this.propertyInfo_0.Length; i++) { this.listBox_0.Items.Add(this.propertyInfo_0[i].Name); } this.button_0.Enabled = false; this.comboBox_0.Enabled = false; this.button_1.Enabled = true; ConfigFileManager.SaveConfig(this.comboBox_0.Text, this.ruleConfigInfo_0); }
private void RuleForm_Load(object sender, EventArgs e) { string[] strArrays = IO.LoadRules(); if ((int)strArrays.Length > 0) { string[] strArrays1 = strArrays; for (int i = 0; i < (int)strArrays1.Length; i++) { object obj = strArrays1[i]; this.comboBox_0.Items.Add(obj); } this.comboBox_0.Text = this.comboBox_0.Items[0].ToString(); } this.taskConfigInfo_0 = (TaskConfigInfo)ConfigFileManager.LoadConfig("TaskConfig.xml", this.taskConfigInfo_0); }
private void button_3_Click(object sender, EventArgs e) { this.tInfo = (TaskConfigInfo)ConfigFileManager.LoadConfig(this.comboBox_4.Text, this.tInfo); this.method_5(); this.label7.Text = Localization.Get("开始生成错误日志..."); this.string_1 = this.comboBox_4.Text; this.tInfo.ID = this.string_2; this.button_3.Enabled = false; DateTime now = DateTime.Now; this.dateTime_0 = now.AddMinutes((double)this.tInfo.Interval); if (!this.backgroundWorker_0.IsBusy) { this.backgroundWorker_0.RunWorkerAsync(); } }
private void comboBox_0_SelectedIndexChanged(object sender, EventArgs e) { if (this.comboBox_0.Items.Count != -1) { this.rInfo = (RuleConfigInfo)ConfigFileManager.LoadConfig(this.comboBox_0.Text, this.rInfo); } else { MessageForm messageForm = new MessageForm() { Text = Localization.Get("错误提示") }; messageForm.MessageText.Text = Localization.Get("你没有选择任何项目"); messageForm.ShowDialog(); } this.textBox_3.Text = this.rInfo.NovelListUrl.Pattern; }
private void HelpUpdateNovel_Load(object sender, EventArgs e) { this.tInfo = (TaskConfigInfo)ConfigFileManager.LoadConfig("TaskConfig.xml", this.tInfo); this.comboBox_0.BeginUpdate(); string[] strArrays = IO.LoadRules(); if ((int)strArrays.Length > 0) { for (int i = 0; i < (int)strArrays.Length; i++) { this.comboBox_0.Items.Add(strArrays[i]); if (strArrays[i] == this.tInfo.RuleFile) { this.comboBox_0.Text = this.tInfo.RuleFile; } } } this.comboBox_0.EndUpdate(); }
private void TaskForm_Load(object sender, EventArgs e) { Guid guid = Guid.NewGuid(); this.string_2 = guid.ToString().ToUpper(); TaskForm taskForm = this; string str = string.Concat(taskForm.Text, " ", this.string_2); taskForm.Text = str; this.tInfo = (TaskConfigInfo)ConfigFileManager.LoadConfig("TaskConfig.xml", this.tInfo); this.comboBox_0.BeginUpdate(); string[] strArrays = IO.LoadRules(); if ((int)strArrays.Length > 0) { for (int i = 0; i < (int)strArrays.Length; i++) { this.comboBox_0.Items.Add(strArrays[i]); if (strArrays[i] == this.tInfo.RuleFile) { this.comboBox_0.Text = this.tInfo.RuleFile; this.rInfo = (RuleConfigInfo)ConfigFileManager.LoadConfig(this.tInfo.RuleFile, this.rInfo); this.textBox_3.Text = this.rInfo.NovelListUrl.Pattern; if (!this.bool_0) { this.Text = string.Concat(this.rInfo.GetSiteName.Pattern, Localization.Get(" 错误生成器")); } } } } this.comboBox_0.EndUpdate(); this.comboBox_4.BeginUpdate(); this.comboBox_4.Items.Add("TaskConfig.xml"); this.comboBox_4.Text = "TaskConfig.xml"; string[] strArrays1 = IO.LoadTasks(); if ((int)strArrays1.Length > 0) { for (int j = 0; j < (int)strArrays1.Length; j++) { this.comboBox_4.Items.Add(strArrays1[j]); } } this.comboBox_4.EndUpdate(); }
private void button_1_Click(object sender, EventArgs e) { this.rInfo = (RuleConfigInfo)ConfigFileManager.LoadConfig(this.comboBox_0.Text, this.rInfo); this.BAuthor = this.checkBox_0.Checked; this.BIntro = this.checkBox_4.Checked; this.BDegree = this.checkBox_3.Checked; this.bool_0 = this.checkBox_1.Checked; this.bool_1 = this.checkBox_2.Checked; this.BCover = this.checkBox_6.Checked; this.BKeyword = this.checkBox_5.Checked; this.MinID = int.Parse(this.textBox_1.Text); this.MaxID = int.Parse(this.textBox_0.Text); this.meminID = int.Parse(this.meminid.Text); this.memaxID = int.Parse(this.memaxid.Text); this.button_0.Enabled = true; this.button_1.Enabled = false; this.groupBox_1.Enabled = false; this.backgroundWorker_0.RunWorkerAsync(); }