private void OnDataSourceTypeChosen(object sender, EventArgs e) { if (this._dataSourceTypesListView.SelectedItems.Count > 0) { DataSourceListViewItem item = this._dataSourceTypesListView.SelectedItems[0] as DataSourceListViewItem; System.Type dataSourceType = item.DataSourceType; this._idTextBox.Text = this.GetNewDataSourceName(dataSourceType); this._descriptionBox.Text = item.GetDescriptionText(); } this.UpdateOKButtonEnabled(); }
protected override void OnClosing(CancelEventArgs e) { if ((base.DialogResult == DialogResult.OK) && (this._dataSourceTypesListView.SelectedItems.Count > 0)) { DataSourceListViewItem item = this._dataSourceTypesListView.SelectedItems[0] as DataSourceListViewItem; System.Type dataSourceType = item.DataSourceType; string str = this.CreateNewDataSource(dataSourceType); if (str.Length > 0) { this._dataSourceID = str; } else { e.Cancel = true; } TypeDescriptor.Refresh(this.GetComponent()); } }