private void SaveKitList() { try { KitReader.SaveKitlist(kitlist, Config.ConfigFolder + KitReader.File); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btAddKit_Click(object sender, EventArgs e) { Kit kit = new Kit(); kit.Name = "rename"; kitlist.Add(kit); RefreshList(); KitReader.SaveKitlist(kitlist, Config.ConfigFolder + KitReader.File); RefreshKitlist(); }
public void ExecuteKits(User user) { StringBuilder builder = new StringBuilder(); List <Kit> kitlist = KitReader.GetKitlist(Config.ConfigFolder + KitReader.File); foreach (Kit kit in kitlist) { builder.AppendFormat("<{0}> ", kit.Name); } ExecuteCommand("say", builder.ToString()); }
private void RefreshKitlist() { try { kitlist = KitReader.GetKitlist(Config.ConfigFolder + KitReader.File); } catch { kitlist = new List <Kit>(); } try { listKitlist.DataSource = kitlist; this.comboBoxID.DisplayMember = "ToString"; // Propertyname aus dem Value Objekt im Dictionary this.comboBoxID.ValueMember = "Value"; this.comboBoxID.DataSource = new BindingSource(mc.Items, null); } catch { MessageBox.Show("items.txt couldn't be found.\nCheck the Settings folder and add items.txt here"); } }