public ConnSQLServer() { InitializeComponent(); this.ShowInTaskbar = false; this.pictureBox1.BackgroundImage = Resources.Resource1.oracle; this.cb_ServerType.DataSource = Biz.Common.Data.Common.GetSQLServerType().ToList(); this.cb_ServerType.DisplayMember = "value"; this.cb_ServerType.ValueMember = "key"; panel_yz.Enabled = true; dbs = dbs ?? (Biz.Common.XMLHelper.DeSerializeFromFile <DBSourceCollection>(Application.StartupPath + Resources.Resource1.DbServersFile) ?? new DBSourceCollection()); this.cb_servers.SelectedIndexChanged += new EventHandler(cb_Servers_SelectedIndexChanged); if (dbs.Count > 0) { this.cb_db.DataSource = dbs.Select(p => new { key = p.DBName, value = p.DBName }).ToList(); this.cb_db.DisplayMember = "value"; this.cb_db.ValueMember = "key"; this.cb_db.SelectedIndex = 0; } this.cb_username.SelectedIndexChanged += cb_username_SelectedIndexChanged; }
public ConnSQLServer() { InitializeComponent(); this.pictureBox1.BackgroundImage = Resources.Resource1.SQLSerTop; this.cb_ServerType.DataSource = Biz.Common.Data.Common.GetSQLServerType().ToList(); this.cb_ServerType.DisplayMember = "value"; this.cb_ServerType.ValueMember = "key"; this.cb_yz.DataSource = Biz.Common.Data.Common.GetEnumIDTypes().ToList(); this.cb_yz.DisplayMember = "value"; this.cb_yz.ValueMember = "key"; this.cb_yz.SelectedIndex = 0; panel_yz.Enabled = false; dbs = dbs ?? (Biz.Common.XMLHelper.DeSerializeFromFile <DBSourceCollection>(Application.StartupPath + Resources.Resource1.DbServersFile) ?? new DBSourceCollection()); this.cb_servers.SelectedIndexChanged += new EventHandler(cb_Servers_SelectedIndexChanged); this.cb_username.SelectedIndexChanged += cb_username_SelectedIndexChanged; }
public DBServerView() { InitializeComponent(); ts_serchKey.Height = 20; _dbServers = new DBSourceCollection(); tv_DBServers.ImageList = new ImageList(); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB1); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB2); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB3); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB4); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB5); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB6); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB7); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB8); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB9); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB10); tv_DBServers.ImageList.Images.Add(Resources.Resource1.DB11); tv_DBServers.Nodes.Add("0", "资源管理器", 0); tv_DBServers.NodeMouseClick += new TreeNodeMouseClickEventHandler(tv_DBServers_NodeMouseClick); this.DBServerviewContextMenuStrip.ItemClicked += new ToolStripItemClickedEventHandler(OnMenuStrip_ItemClicked); this.CommMenuStrip.ItemClicked += new ToolStripItemClickedEventHandler(CommMenuStrip_ItemClicked); }