private void ckbAutoSave_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         MainForm.WaveformConfigData.IsAutoSaveConfig = ckbAutoSave.Checked;
         ConfigManger.SaveConfigData(MainForm.WaveformConfigData);
     }
     catch (Exception ex)
     {
         MyLogger.logger.Error("保存配置文件-自动保存失败:" + ex.Message + ",堆栈:" + ex.StackTrace);
     }
 }
 private void ckbShowInvaildData_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         ConfigManger.SaveConfigData(MainForm.WaveformConfigData);
         MainForm.sMainform.picMainGraphics.Invalidate();
     }
     catch (Exception ex)
     {
         MyLogger.logger.Error("保存配置文件-显示无效数据:" + ex.Message + ",堆栈:" + ex.StackTrace);
     }
 }
 private void LoadCustomToolStripItem()
 {
     listBoxCustom.DataSource = null;
     listBoxCustom.Items.Clear();
     dicCustom.Clear();
     if (MainForm.sMainform.tsCustom.Items.Count > 0)
     {
         int itemsCount = MainForm.sMainform.tsCustom.Items.Count - 1;
         for (int i = 0; i < itemsCount; i++)
         {
             dicCustom.Add(MainForm.sMainform.tsCustom.Items[i].Text, (ToolStripButton)MainForm.sMainform.tsCustom.Items[i]);
         }
     }
     if (dicCustom.Count > 0)
     {
         listBoxCustom.DataSource    = new BindingSource(dicCustom, null);
         listBoxCustom.DisplayMember = "Key";
         listBoxCustom.ValueMember   = "Value";
         config.statusBarList        = dicCustom.Values.Select(p => p.Name).ToList();
         listBoxCustom.SelectedItems.Clear();
     }
     ConfigManger.SaveLayoutConfig(config);
 }
Beispiel #4
0
 public DiscordBot(string ConfigPath)
 {
     cacheManger  = new CacheManger <string> ();
     configManger = new ConfigManger(ConfigPath);
 }