コード例 #1
0
        private void buttonRename_Click(object sender, EventArgs e)
        {
            KeytypeDialog ktd = new KeytypeDialog(selectedType);
            DialogResult result = ktd.ShowDialog();
            if (result == DialogResult.OK)
            {
                selectedType.Save();
                foreach (TreeNode node in treeViewTypes.Nodes)
                {
                    if ((KeyType)node.Tag == selectedType)
                    {
                        node.Text = selectedType.Name;
                    }
                }
                labelTypeTitle.Text = "Key Type: " + selectedType.Name;

            }
            ktd.Dispose();
        }
コード例 #2
0
        private void buttonKeyTabEditType_Click(object sender, EventArgs e)
        {
            KeyType type = objects.getKeyTypeByName((string)comboBoxKeyTabKeyType.SelectedItem);
            if (type != null)
            {
                KeytypeDialog ktd = new KeytypeDialog(type);
                DialogResult result = ktd.ShowDialog();
                if (result == DialogResult.OK)
                {
                    type.Save(); // updates the database

                    // update the UI
                    initializeKeyTab();
                    comboBoxKeyTabKeyType.SelectedItem = type.Name;
                }
            }
        }
コード例 #3
0
 private void buttonCreateType_Click(object sender, EventArgs e)
 {
     KeytypeDialog ktd = new KeytypeDialog();
     DialogResult result = ktd.ShowDialog();
     if (result == DialogResult.OK)
     {
         KeyType type = ktd.keytype;
         type.Save();
         objects.keytypes.Add(type);
         bool isOdd = treeViewTypes.Nodes.Count % 2 == 0;
         TreeNode newNode = treeViewTypes.Nodes.Add(type.Name);
         newNode.Tag = type;
         newNode.BackColor = isOdd ? lightBlue : Color.White;
     }
     ktd.Dispose();
 }
コード例 #4
0
        private void buttonKeyTabNewType_Click(object sender, EventArgs e)
        {
            KeytypeDialog ktd = new KeytypeDialog();
            DialogResult result = ktd.ShowDialog();
            if (result == DialogResult.OK)
            {
                KeyType type = ktd.keytype;
                objects.keytypes.Add(type); // updates the OOP
                type.Save(); // updates the database

                // update the UI
                comboBoxKeyTabKeyType.Items.Add(type.Name);
                comboBoxKeyTabKeyType.SelectedItem = type.Name;
            }
        }