Exemplo n.º 1
0
        private void MenuItem_数据库属性_Click_1(object sender, RoutedEventArgs e)
        {
            DatabaseItemNode databaseItemNode = tree1.SelectedItem as DatabaseItemNode;
            ProjectNode      projectNode      = databaseItemNode.Parent.Parent as ProjectNode;

            Forms.DatabaseEditor form = new Forms.DatabaseEditor(projectNode.Project.id.Value, databaseItemNode.Database);
            form.Title = "数据库属性";
            form.Owner = this;
            if (form.ShowDialog() == true)
            {
                databaseItemNode.Parent.ReBindItems();
            }
        }
Exemplo n.º 2
0
        private void MenuItem_创建数据库_Click_1(object sender, RoutedEventArgs e)
        {
            MenuItem    item        = (MenuItem)sender;
            ContextMenu menu        = (ContextMenu)item.Parent;
            var         obj         = (StackPanel)menu.PlacementTarget;
            ProjectNode projectNode = (ProjectNode)obj.Tag;

            Forms.DatabaseEditor form = new Forms.DatabaseEditor(projectNode.Project.id.Value);
            form.Title = "新建数据库";
            form.Owner = this;
            if (form.ShowDialog() == true)
            {
                DatabaseNode dbnode = (DatabaseNode)projectNode.Children.Where(m => m is TreeNode.DatabaseNode).FirstOrDefault();
                dbnode.ReBindItems();
            }
        }