private void addNewSectionToolStripMenuItem_Click(object sender, EventArgs e) { NewSectionForm newSectionForm = new NewSectionForm(); if (newSectionForm.ShowDialog() == DialogResult.OK) { Bank.Section section = new Bank.Section { Name = newSectionForm.SectionName }; _bank.Sections.Add(section); SaveBank(); RefreshBankProperties(); } }
private void addNewItemToolStripMenuItem_Click(object sender, EventArgs e) { NewSectionItemForm newSectionItemForm = new NewSectionItemForm(_bank); Bank.Key selectedKey = GetSelectedKey(); if (selectedKey != null) { newSectionItemForm.Section = selectedKey.Section; } if (newSectionItemForm.ShowDialog() == DialogResult.OK) { Bank.Section selectedSection = newSectionItemForm.Section; Bank.Key bankKey = new Bank_Stuffs.Bank.Key(); bankKey.Name = newSectionItemForm.ItemName; bankKey.Section = selectedSection; bankKey.Type = "string"; bankKey.Value = ""; selectedSection.Keys.Add(bankKey); SaveBank(); RefreshBankProperties(); } }
private void cmbSections_Format(object sender, ListControlConvertEventArgs e) { Bank.Section section = (Bank.Section)e.ListItem; e.Value = section.Name; }
private string GroupKeyToTitleConverter(object groupkey) { Bank.Section section = (Bank.Section)groupkey; return(section.Name); }