예제 #1
0
        private void RefreshSelected()
        {
            TreeNodeController controller = treeView.SelectedNode.Tag as TreeNodeController;

            if (controller != null)
            {
                controller.PerformRefresh(treeView.SelectedNode);
            }
        }
예제 #2
0
        private void treeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            TreeNodeController controller = treeView.SelectedNode.Tag as TreeNodeController;

            if (controller != null)
            {
                controller.PerformDoubleClick(e.Node);
            }
        }
예제 #3
0
        private void treeView_TreeNodePopulate(object sender, TreeViewEventArgs e)
        {
            TreeNodeController controller = e.Node.Tag as TreeNodeController;

            if (controller != null)
            {
                controller.PerformPopulate(e.Node);
            }
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
        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));
            }
        }
예제 #9
0
        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);
        }
예제 #10
0
        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);
        }
예제 #11
0
        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);
        }
예제 #12
0
 virtual bool CanDrop(TreeNodeController source, DragDropEffects effect);
예제 #13
0
 override bool CanDrop(TreeNodeController source, DragDropEffect effect)
 {
     return(false);
 }
예제 #14
0
 override bool CanDrop(TreeNodeController source, DragDropEffect effect)
 {
     return(!IsReadOnly && !data.IsChildOf(source.data) && effect == DragDropEffect.Move);
 }