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)); } }
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)); } }
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"); } } }
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"); } } }
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)); } }
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)); } }