예제 #1
0
        private void изменитьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (tn is BooksTreeNode)
            {
                var btn = tn as BooksTreeNode;
                var id  = Settings.GetID <Book>(btn.Book, Book.FileArrayName);

                UI.AddBook cnv = new UI.AddBook((uint)id);
                if (cnv.ShowDialog() == DialogResult.OK)
                {
                    UpdateTree();
                }
            }
            else if (tn is CategoryTreeNode)
            {
                var btn = tn as CategoryTreeNode;
                var id  = Settings.GetID <Categories>(btn.Categories, Categories.FileArrayName);

                UI.AddCategory cnv = new UI.AddCategory((uint)id);
                if (cnv.ShowDialog() == DialogResult.OK)
                {
                    UpdateTree();
                }
            }
        }
예제 #2
0
        private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (tn is BooksTreeNode)
            {
                var btn = tn as BooksTreeNode;
                var id  = Settings.GetID <Book>(btn.Book, Book.FileArrayName);

                UI.AddBook cnv = new UI.AddBook((uint)id);
                if (cnv.ShowDialog() == DialogResult.OK)
                {
                    UpdateTree();
                }
            }
            else if (tn is CategoryTreeNode)
            {
                var btn = tn as CategoryTreeNode;
                var id  = Settings.GetID <Categories>(btn.Categories, Categories.FileArrayName);

                UI.AddCategory cnv = new UI.AddCategory((uint)id);
                if (cnv.ShowDialog() == DialogResult.OK)
                {
                    UpdateTree();
                }
            }
        }
예제 #3
0
 private void добавитьToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     UI.AddCategory cnv = new UI.AddCategory();
     if (cnv.ShowDialog() == DialogResult.OK)
     {
         UpdateTree();
     }
 }