コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
 private void cmbSections_Format(object sender, ListControlConvertEventArgs e)
 {
     Bank.Section section = (Bank.Section)e.ListItem;
     e.Value = section.Name;
 }
コード例 #4
0
 private string GroupKeyToTitleConverter(object groupkey)
 {
     Bank.Section section = (Bank.Section)groupkey;
     return(section.Name);
 }