Наследование: System.Windows.Forms.Form
Пример #1
0
        private void toolStripMenuItem7_Click(object sender, EventArgs e)
        {
            var node = treeViewMenu.SelectedNode;
            var nif  = new NewItemForm("Create new database", "Database name");

            if (nif.ShowDialog() == DialogResult.OK)
            {
                MDB.CreateDatabase(nif.EnteredValue);
                node.Nodes.Add(new DbNode(nif.EnteredValue, ctxMenuStripDb));
            }
        }
Пример #2
0
        private void createToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var node   = treeViewMenu.SelectedNode;
            var dbNode = node as DbNode;
            var nif    = new NewItemForm("Create new collection", "Collection name");

            if (nif.ShowDialog() == DialogResult.OK)
            {
                MDB.CreateCollection(dbNode.DbName, nif.EnteredValue);
                dbNode.Nodes.Add(new CollectionNode(dbNode.DbName + "." + nif.EnteredValue, ctxMenuStripCol));
            }
        }
Пример #3
0
        private void createIndexToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //db.system.indexes.insert({ name: "name", ns: "namespaceToIndex", key: <keypattern> });
            var node = treeViewMenu.SelectedNode as CollectionNode;
            var nif  = new NewItemForm("Create new index", "Enter index key pattern (examples: '{tag:1}' '{name:1,tag:1}' '{tags.tag:1}'");

            if (nif.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    var d = MDB.CreateIndexes(node.DbNode.DbName, node.CollectionNamespace, nif.EnteredValue);
                    node.Nodes.Add(new IndexNode(d, ctxMenuStripIndex));
                }
                catch (ArgumentException aex)
                {
                    MessageBox.Show(aex.Message, "Error");
                }
            }
        }
Пример #4
0
 private void createIndexToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //db.system.indexes.insert({ name: "name", ns: "namespaceToIndex", key: <keypattern> });
     var node = treeViewMenu.SelectedNode as CollectionNode;
     var nif = new NewItemForm("Create new index", "Enter index key pattern (examples: '{tag:1}' '{name:1,tag:1}' '{tags.tag:1}'");
     if(nif.ShowDialog() == DialogResult.OK)
     {
         try
         {
             var d = MDB.CreateIndexes(node.DbNode.DbName, node.CollectionNamespace, nif.EnteredValue);
             node.Nodes.Add(new IndexNode(d, ctxMenuStripIndex));
         }
         catch(ArgumentException aex)
         {
             MessageBox.Show(aex.Message, "Error");
         }
     }
 }
Пример #5
0
 private void toolStripMenuItem7_Click(object sender, EventArgs e)
 {
     var node = treeViewMenu.SelectedNode;
     var nif = new NewItemForm("Create new database", "Database name");
     if(nif.ShowDialog() == DialogResult.OK)
     {
         MDB.CreateDatabase(nif.EnteredValue);
         node.Nodes.Add(new DbNode(nif.EnteredValue, ctxMenuStripDb));
     }
 }
Пример #6
0
 private void createToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var node = treeViewMenu.SelectedNode;
     var dbNode = node as DbNode;
     var nif = new NewItemForm("Create new collection", "Collection name");
     if(nif.ShowDialog() == DialogResult.OK)
     {
         MDB.CreateCollection(dbNode.DbName, nif.EnteredValue);
         dbNode.Nodes.Add(new CollectionNode(dbNode.DbName + "." + nif.EnteredValue,ctxMenuStripCol));
     }
 }