コード例 #1
0
 private void cboDb_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboDb.SelectedIndex > 0)
     {
         var      id         = (int)cboDb.SelectedValue;
         var      conn       = _proj.ProjectDatabases.Where(d => d.ProjectDatabaeId == id).First();
         DBWorker worker     = new DBWorker();
         var      entityList = worker.GetEntitiesFromDatabase(conn);
         // exclude entities already in the system
         List <string> nameList = _proj.Entities.Select(a => a.EntityName).ToList();
         var           list     = entityList.Where(a => !nameList.Contains(a.EntityName)).ToList();
         entityBindingSource.DataSource = list;
         // select all entities
         SelectRows(true);
     }
 }