コード例 #1
0
        private void Add_ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode tn     = this.treeView1.SelectedNode;
            string   btnstr = (sender as ToolStripItem).Text;


            if (btnstr == "添加服务程序")
            {
                editServiceApp editapps = new editServiceApp();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (btnstr == "添加网站程序")
            {
                editWebApp editapps = new editWebApp();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (btnstr == "添加虚拟目录")
            {
                editWebAppVirtualDirctory editapps = new editWebAppVirtualDirctory();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }

            else if (btnstr == "添加桌面程序")
            {
                editApp editapps = new editApp();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (btnstr == "添加FTP站点")
            {
                editFtp editapps = new editFtp();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (btnstr == "添加共享目录")
            {
                editGxml editapps = new editGxml();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            // 数据库

            else if (btnstr == "设置管理员")
            {
                editDbSystemUser editapps = new editDbSystemUser();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (btnstr == "添加普通用户")
            {
                editDbUser editapps = new editDbUser();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (btnstr == "添加SDE用户")
            {
                editDbSdeUser editapps = new editDbSdeUser();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            //鍙傛暟
            else if (btnstr == "添加参数")
            {
                editPar editapps = new editPar();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }

            // 鑷畾涔夋寜閽?
            else if (btnstr == "添加工具")
            {
                editBtn editapps = new editBtn();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (btnstr == "添加工具参数")
            {
                editBtnInput editapps = new editBtnInput();
                editapps.isNew = true;
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }

            else
            {
                this.panel1.Controls.Clear();
            }

            this.btnNodeSave.Visible = true;
        }
コード例 #2
0
        private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            this.btnNodeSave.Visible = true;
            TreeNode tn = e.Node as TreeNode;

            if (tn.Tag is Apps)
            {
                editApps editapps = new editApps();
                editapps.setValue(tn.Tag as Apps);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (tn.Tag is ServiceApp)
            {
                editServiceApp editapps = new editServiceApp();
                editapps.setValue(tn.Tag as ServiceApp);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (tn.Tag is WebApp)
            {
                editWebApp editapps = new editWebApp();
                editapps.setValue(tn.Tag as WebApp);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (tn.Tag is WebAppVirtualDir)
            {
                editWebAppVirtualDirctory editapps = new editWebAppVirtualDirctory();
                editapps.setValue(tn.Tag as WebAppVirtualDir);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (tn.Tag is App)
            {
                editApp editapps = new editApp();
                editapps.setValue(tn.Tag as App);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (tn.Tag is Ftp)
            {
                editFtp editapps = new editFtp();
                editapps.setValue(tn.Tag as Ftp);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (tn.Tag is Gxml)
            {
                editGxml editapps = new editGxml();
                editapps.setValue(tn.Tag as Gxml);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            // 数据库
            else if (tn.Tag is Db)
            {
                editDb editapps = new editDb();
                editapps.setValue(tn.Tag as Db);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (tn.Tag is DbSystemUser)
            {
                editDbSystemUser editapps = new editDbSystemUser();
                editapps.setValue(tn.Tag as DbSystemUser);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (tn.Tag is DbUser)
            {
                editDbUser editapps = new editDbUser();
                editapps.setValue(tn.Tag as DbUser);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (tn.Tag is DbSdeUser)
            {
                editDbSdeUser editapps = new editDbSdeUser();
                editapps.setValue(tn.Tag as DbSdeUser);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            //参数
            else if (tn.Tag is Par)
            {
                editPar editapps = new editPar();
                editapps.setValue(tn.Tag as Par);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }

            // 自定义工具
            else if (tn.Tag is Btn)
            {
                editBtn editapps = new editBtn();
                editapps.setValue(tn.Tag as Btn);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else if (tn.Tag is Input)
            {
                editBtnInput editapps = new editBtnInput();
                editapps.setValue(tn.Tag as Input);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            //备份
            else if (tn.Tag is Backup)
            {
                editBackup editapps = new editBackup();
                editapps.setValue(tn.Tag as Backup);
                this.panel1.Controls.Clear();
                this.panel1.Controls.Add(editapps);
            }
            else
            {
                this.panel1.Controls.Clear();
                this.btnNodeSave.Visible = false;
            }
        }