private void RefreshSelected() { TreeNodeController controller = treeView.SelectedNode.Tag as TreeNodeController; if (controller != null) { controller.PerformRefresh(treeView.SelectedNode); } }
private void treeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { TreeNodeController controller = treeView.SelectedNode.Tag as TreeNodeController; if (controller != null) { controller.PerformDoubleClick(e.Node); } }
private void treeView_TreeNodePopulate(object sender, TreeViewEventArgs e) { TreeNodeController controller = e.Node.Tag as TreeNodeController; if (controller != null) { controller.PerformPopulate(e.Node); } }
private TreeNode CreateTriggerNode(Trigger trigger) { TreeNode node = CreateTreeNode(trigger.Name, "trigger", null); TreeNodeController controller = new TreeNodeController(); controller.DoubleClick += delegate { OpenQuery(trigger.Database, trigger.GenerateAlterStatement()); }; controller.Tag = trigger; node.Tag = controller; return(node); }
private TreeNode CreateUserDefinedFunctionNode(UserDefinedFunction userDefinedFunction) { TreeNode node = CreateTreeNode(userDefinedFunction.Name, "function", procedureContextMenu); node.Nodes.Add(String.Empty); TreeNodeController controller = new TreeNodeController(); controller.Populate += delegate { AddParameters(node, userDefinedFunction); }; controller.Refresh += delegate { userDefinedFunction.RefreshParameters(); }; controller.Tag = userDefinedFunction; node.Tag = controller; return(node); }
private TreeNode CreateStoredProcedureNode(StoredProcedure storedProdecure) { TreeNode node = CreateTreeNode(storedProdecure.Name, "storedProcedure", procedureContextMenu); node.Nodes.Add(String.Empty); TreeNodeController controller = new TreeNodeController(); controller.Populate += delegate { AddParameters(node, storedProdecure); }; controller.Refresh += delegate { storedProdecure.RefreshParameters(); }; controller.Tag = storedProdecure; node.Tag = controller; return(node); }
private TableNode CreateTableNode(Table table) { TableNode node = new TableNode(table); node.ContextMenuStrip = tableContextMenu; TreeNodeController controller = new TreeNodeController(); controller.Populate += delegate { AddColumns(node); }; controller.Refresh += delegate { table.Refresh(); Unpopulate(node); }; controller.Tag = table; node.Tag = controller; return(node); }
private void ShowNodeProperties(TreeNode node) { object obj = null; TreeNodeController controller = node.Tag as TreeNodeController; if (controller != null) { refreshToolStripButton.Enabled = controller.SupportsRefresh; obj = controller.Tag; } else { refreshToolStripButton.Enabled = false; } if (ShowProperties != null) { ShowProperties(this, new OpenPropertiesEventArgs(obj)); } }
private TreeNode CreateUserDefinedFunctionsFolderNode(Database db) { TreeNode node = CreateFolderNode("User Defined Functions"); node.Nodes.Add(String.Empty); TreeNodeController controller = new TreeNodeController(); controller.Populate += delegate { foreach (UserDefinedFunction fn in db.UserDefinedFunctions) { node.Nodes.Add(CreateUserDefinedFunctionNode(fn)); } }; controller.Refresh += delegate { db.RefreshUserDefinedFunctions(); Unpopulate(node); }; node.Tag = controller; return(node); }
private TreeNode CreateStoredProceduresFolderNode(Database db) { TreeNode node = CreateFolderNode("Stored Procedures"); node.Nodes.Add(String.Empty); TreeNodeController controller = new TreeNodeController(); controller.Populate += delegate { foreach (StoredProcedure sp in db.StoredProcedures) { node.Nodes.Add(CreateStoredProcedureNode(sp)); } }; controller.Refresh += delegate { db.RefreshStoredProcedures(); Unpopulate(node); }; node.Tag = controller; return(node); }
private DatabaseNode CreateDatabaseNode(Database db) { DatabaseNode node = new DatabaseNode(db); node.AsyncException += DatabaseConnect_AsyncException; node.ContextMenuStrip = databaseContextMenu; node.Nodes.Add(String.Empty); TreeNodeController controller = new TreeNodeController(); controller.Populate += delegate { AddTables(node); }; controller.Refresh += delegate { db.RefreshTables(); Unpopulate(node); }; controller.DoubleClick += delegate { if (!node.IsExpanded) { node.Expand(); } }; controller.Tag = new ConnectionSettings(db); node.Tag = controller; return(node); }
virtual bool CanDrop(TreeNodeController source, DragDropEffects effect);
override bool CanDrop(TreeNodeController source, DragDropEffect effect) { return(false); }
override bool CanDrop(TreeNodeController source, DragDropEffect effect) { return(!IsReadOnly && !data.IsChildOf(source.data) && effect == DragDropEffect.Move); }