Пример #1
0
        private void InitData()
        {
            var list = DbXmlHelper.GetList();

            this.Invoke(new Action <ListBox>(p =>
            {
                foreach (var item in list)
                {
                    p.Items.Add(item.Name);
                }
            }), this.lstdb);

            this.lstStructure.Columns.Add("索引", 60, HorizontalAlignment.Left);
            this.lstStructure.Columns.Add("列名", 120, HorizontalAlignment.Left);
            this.lstStructure.Columns.Add("类型", 90, HorizontalAlignment.Left);
            this.lstStructure.Columns.Add("非空", 60, HorizontalAlignment.Left);
            this.lstStructure.Columns.Add("主键", 60, HorizontalAlignment.Left);
        }
Пример #2
0
        private void lstdb_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int index = this.lstdb.IndexFromPoint(e.Location);

            if (index != System.Windows.Forms.ListBox.NoMatches)
            {
                string name = lstdb.Items[index].ToString();

                this.xmlInfo = DbXmlHelper.GetItem(name);
                if (this.xmlInfo != null)
                {
                    var tableList = DbManager.ReadAllTables(this.xmlInfo.Path, this.xmlInfo.Pwd);
                    this.Invoke(new Action <ListBox>(p =>
                    {
                        foreach (var table in tableList)
                        {
                            p.Items.Add(table);
                        }
                    }), this.lstTables);
                }
            }
        }