public frmConnections(Project proj) { InitializeComponent(); progressBarLoad.Value = 0; workerLoadDB.DoWork += new DoWorkEventHandler(LoadDB_DoWork); workerLoadDB.RunWorkerCompleted += new RunWorkerCompletedEventHandler(LoadDB_RunWorkerCompleted); workerLoadDB.ProgressChanged += new ProgressChangedEventHandler(LoadDB_ProgressChanged); _project = proj; Settings settings = new Settings(); _filter = new DBReaderFilter(); checkBox1.Checked = _filter.IncludeViewAsEntities; checkBox2.Checked = _filter.IncludeTablesAsEntities; foreach( DataSource source in settings.Connections) { comboBox1.Items.Add(source); } if (comboBox1.Items.Count > 0) { comboBox1.SelectedIndex = 0; } }
public ModelExporter(Settings settings) { _Settings = settings; }
private void btnLoad_Click(object sender, EventArgs e) { dataSource = (DataSource)comboBox1.SelectedItem; if (dataSource == null) { string connstr = comboBox1.Text; dataSource = new DataSource(); dataSource.ConnectionString = connstr; Settings settings = new Settings(); settings.Connections.Add(dataSource); } if (!workerLoadDB.IsBusy) { progressBarLoad.Maximum = 100; progressBarLoad.Minimum = 0; progressBarLoad.Visible = true; progressBarLoad.Text = "Load Starting"; workerLoadDB.RunWorkerAsync(); } }