⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbbrowser.cs

📁 通过数据库结构自动 生成三层结构代码,相当不错的一款软件
💻 CS
📖 第 1 页 / 共 2 页
字号:
            this.toolStripSeparator1 = new ToolStripSeparator();
            this.toolStripSplitButton1 = new ToolStripSplitButton();
            this.列表ToolStripMenuItem = new ToolStripMenuItem();
            this.详细信息ToolStripMenuItem = new ToolStripMenuItem();
            this.listView1 = new ListView();
            this.groupBox1 = new GroupBox();
            this.lblViewInfo = new Label();
            this.pictureBox1 = new PictureBox();
            this.imglistView = new ImageList(this.components);
            this.lblNum = new Label();
            this.imglistDB = new ImageList(this.components);
            this.toolStrip1.SuspendLayout();
            ((ISupportInitialize) this.pictureBox1).BeginInit();
            base.SuspendLayout();
            this.toolStrip1.BackgroundImage = (Image) manager.GetObject("toolStrip1.BackgroundImage");
            this.toolStrip1.Items.AddRange(new ToolStripItem[] { this.toolStripButton2, this.toolStripSeparator1, this.toolStripSplitButton1 });
            this.toolStrip1.Location = new Point(0, 0);
            this.toolStrip1.Name = "toolStrip1";
            this.toolStrip1.Size = new Size(0x1ca, 0x1a);
            this.toolStrip1.TabIndex = 0;
            this.toolStrip1.Text = "toolStrip1";
            this.toolStripButton2.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.toolStripButton2.Image = (Image) manager.GetObject("toolStripButton2.Image");
            this.toolStripButton2.ImageScaling = ToolStripItemImageScaling.None;
            this.toolStripButton2.ImageTransparentColor = Color.Magenta;
            this.toolStripButton2.Name = "toolStripButton2";
            this.toolStripButton2.Size = new Size(0x17, 0x17);
            this.toolStripButton2.Text = "toolStripButton2";
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new Size(6, 0x1a);
            this.toolStripSplitButton1.DropDownItems.AddRange(new ToolStripItem[] { this.列表ToolStripMenuItem, this.详细信息ToolStripMenuItem });
            this.toolStripSplitButton1.Image = (Image) manager.GetObject("toolStripSplitButton1.Image");
            this.toolStripSplitButton1.ImageScaling = ToolStripItemImageScaling.None;
            this.toolStripSplitButton1.ImageTransparentColor = Color.Magenta;
            this.toolStripSplitButton1.Name = "toolStripSplitButton1";
            this.toolStripSplitButton1.Size = new Size(0x40, 0x17);
            this.toolStripSplitButton1.Text = "列表";
            this.列表ToolStripMenuItem.Image = (Image) manager.GetObject("列表ToolStripMenuItem.Image");
            this.列表ToolStripMenuItem.ImageScaling = ToolStripItemImageScaling.None;
            this.列表ToolStripMenuItem.Name = "列表ToolStripMenuItem";
            this.列表ToolStripMenuItem.Size = new Size(0x79, 0x1a);
            this.列表ToolStripMenuItem.Text = "列表";
            this.详细信息ToolStripMenuItem.Image = (Image) manager.GetObject("详细信息ToolStripMenuItem.Image");
            this.详细信息ToolStripMenuItem.ImageScaling = ToolStripItemImageScaling.None;
            this.详细信息ToolStripMenuItem.Name = "详细信息ToolStripMenuItem";
            this.详细信息ToolStripMenuItem.Size = new Size(0x79, 0x1a);
            this.详细信息ToolStripMenuItem.Text = "详细信息";
            this.listView1.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.listView1.Location = new Point(12, 0x59);
            this.listView1.Name = "listView1";
            this.listView1.Size = new Size(0x1b2, 0x103);
            this.listView1.TabIndex = 1;
            this.listView1.UseCompatibleStateImageBehavior = false;
            this.groupBox1.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.groupBox1.Location = new Point(12, 0x43);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x1b2, 8);
            this.groupBox1.TabIndex = 2;
            this.groupBox1.TabStop = false;
            this.lblViewInfo.AutoSize = true;
            this.lblViewInfo.Location = new Point(0x3b, 0x2b);
            this.lblViewInfo.Name = "lblViewInfo";
            this.lblViewInfo.Size = new Size(0x29, 12);
            this.lblViewInfo.TabIndex = 3;
            this.lblViewInfo.Text = "label1";
            this.pictureBox1.Image = (Image) manager.GetObject("pictureBox1.Image");
            this.pictureBox1.InitialImage = (Image) manager.GetObject("pictureBox1.InitialImage");
            this.pictureBox1.Location = new Point(12, 0x21);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new Size(0x20, 0x20);
            this.pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
            this.pictureBox1.TabIndex = 4;
            this.pictureBox1.TabStop = false;
            this.imglistView.ImageStream = (ImageListStreamer) manager.GetObject("imglistView.ImageStream");
            this.imglistView.TransparentColor = Color.Transparent;
            this.imglistView.Images.SetKeyName(0, "server.ico");
            this.imglistView.Images.SetKeyName(1, "db.gif");
            this.imglistView.Images.SetKeyName(2, "tab2.gif");
            this.imglistView.Images.SetKeyName(3, "view.gif");
            this.imglistView.Images.SetKeyName(4, "fild2.gif");
            this.imglistView.Images.SetKeyName(5, "sp.gif");
            this.lblNum.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.lblNum.AutoSize = true;
            this.lblNum.Location = new Point(0x198, 0x2e);
            this.lblNum.Name = "lblNum";
            this.lblNum.Size = new Size(0x1d, 12);
            this.lblNum.TabIndex = 5;
            this.lblNum.Text = "0 项";
            this.imglistDB.ImageStream = (ImageListStreamer) manager.GetObject("imglistDB.ImageStream");
            this.imglistDB.TransparentColor = Color.Transparent;
            this.imglistDB.Images.SetKeyName(0, "db.gif");
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x1ca, 360);
            base.Controls.Add(this.lblNum);
            base.Controls.Add(this.pictureBox1);
            base.Controls.Add(this.lblViewInfo);
            base.Controls.Add(this.groupBox1);
            base.Controls.Add(this.listView1);
            base.Controls.Add(this.toolStrip1);
            base.Name = "DbBrowser";
            this.Text = "DbBrowser";
            this.toolStrip1.ResumeLayout(false);
            this.toolStrip1.PerformLayout();
            ((ISupportInitialize) this.pictureBox1).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        public void SetListView(DbView dbviewfrm)
        {
            TreeNode selectedNode = dbviewfrm.treeView1.SelectedNode;
            if (selectedNode != null)
            {
                string servername = "";
                switch (selectedNode.Tag.ToString())
                {
                    case "server":
                        servername = selectedNode.Text;
                        this.CreatDbObj(servername);
                        this.lblViewInfo.Text = " 服务器:" + servername;
                        this.lblNum.Text = selectedNode.Nodes.Count.ToString() + "项";
                        this.listView1.Columns.Clear();
                        this.listView1.Items.Clear();
                        this.listView1.LargeImageList = this.imglistDB;
                        this.listView1.View = View.LargeIcon;
                        foreach (TreeNode node2 in selectedNode.Nodes)
                        {
                            string text = node2.Text;
                            ListViewItem item = new ListViewItem(text, 0);
                            item.SubItems.Add(text);
                            item.ImageIndex = 0;
                            this.listView1.Items.AddRange(new ListViewItem[] { item });
                        }
                        this.SetListViewMenu("db");
                        return;

                    case "db":
                        servername = selectedNode.Parent.Text;
                        this.CreatDbObj(servername);
                        this.lblViewInfo.Text = " 数据库:" + selectedNode.Text;
                        this.lblNum.Text = selectedNode.Nodes.Count.ToString() + "项";
                        this.SetListViewMenu("table");
                        this.BindlistViewTab(selectedNode.Text, selectedNode.Tag.ToString());
                        return;

                    case "tableroot":
                    case "viewroot":
                    case "procroot":
                    {
                        servername = selectedNode.Parent.Parent.Text;
                        string dbname = selectedNode.Parent.Text;
                        this.CreatDbObj(servername);
                        this.lblViewInfo.Text = " 数据库:" + dbname;
                        this.lblNum.Text = selectedNode.Nodes.Count.ToString() + "项";
                        this.SetListViewMenu("table");
                        this.BindlistViewTab(dbname, selectedNode.Tag.ToString());
                        return;
                    }
                    case "table":
                    case "view":
                    {
                        servername = selectedNode.Parent.Parent.Parent.Text;
                        string str4 = selectedNode.Parent.Parent.Text;
                        string tableName = selectedNode.Text;
                        this.CreatDbObj(servername);
                        this.lblViewInfo.Text = " 表:" + tableName;
                        this.lblNum.Text = selectedNode.Nodes.Count.ToString() + "项";
                        this.SetListViewMenu("column");
                        this.BindlistViewCol(str4, tableName);
                        return;
                    }
                    case "proc":
                    {
                        servername = selectedNode.Parent.Parent.Parent.Text;
                        string text1 = selectedNode.Parent.Parent.Text;
                        string str6 = selectedNode.Text;
                        this.CreatDbObj(servername);
                        this.lblViewInfo.Text = " 存储过程:" + str6;
                        this.lblNum.Text = selectedNode.Nodes.Count.ToString() + "项";
                        this.listView1.Items.Clear();
                        return;
                    }
                    case "column":
                        servername = selectedNode.Parent.Parent.Parent.Parent.Text;
                        return;
                }
            }
        }

        private void SetListViewMenu(string itemType)
        {
            string str;
            if ((((str = itemType.ToLower()) != null) && !(str == "server")) && (((str == "db") || (str == "table")) || !(str == "column")))
            {
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -