private void ConnectionsCombo_SelectedIndexChanged(ComboBox comboxBox, ref string connMgrNameVariable, string connMgrType, ConnectionManagerUIArgs connUIargs, DTSFileConnectionUsageType?uType) { // Check for index 0 and <New Item...> if (comboxBox.SelectedIndex == 0) { // Use connection service to create a new connection. ArrayList newConns = _dtsConnectionService.CreateConnection(connMgrType, connUIargs); if (newConns.Count > 0) { // A new connection has been created, so populate and select ConnectionManager newConn = (ConnectionManager)newConns[0]; connMgrNameVariable = newConn.Name; PopulateConnectionsCombo(comboxBox, connMgrType, newConn.Name, uType); } else { // Create connection has been cancelled //comboxBox.SelectedIndex = -1; } } else { connMgrNameVariable = comboxBox.SelectedItem.ToString(); } }
private void ConnectionManagercomboBox_SelectedIndexChanged(object sender, EventArgs e) { ComboBox comboxBox = (ComboBox)sender; // Check for index 0 and <New Item...> if (comboxBox.SelectedIndex == 0) { // Use connection service to create a new connection. ArrayList newConns = _dtsConnectionService.CreateConnection("SSH"); if (newConns.Count > 0) { // A new connection has been created, so populate and select ConnectionManager newConn = (ConnectionManager)newConns[0]; _connMgrName = newConn.Name; PopulateConnectionsCombo(comboxBox, "SSH", newConn.Name); } else { // Create connection has been cancelled comboxBox.SelectedIndex = -1; } } else { _connMgrName = ConnectionManagercomboBox.SelectedItem.ToString(); } }
void page_CreateNewConnection(object sender, EventArgs args) { IDtsConnectionService ConnectionService = (IDtsConnectionService)this.ServiceProvider.GetService(typeof(IDtsConnectionService)); if (ConnectionService == null) { Exception ex = new InvalidOperationException("Connection Service Unavailable"); this.ReportErrors(ex); return; } ArrayList connections = ConnectionService.CreateConnection("SSDS"); if (connections != null && connections.Count > 0) { ConnectionManager cm = connections[connections.Count - 1] as ConnectionManager; this.ComponentMetadata.RuntimeConnectionCollection[0].ConnectionManagerID = cm.ID; this.ComponentMetadata.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(cm); } return; }
private void cmbSqlConnections_SelectedValueChanged(object sender, EventArgs e) { ComboBox comboxBox = (ComboBox)sender; // Check for index 0 and <New Item...> if (comboxBox.SelectedIndex == 0) { // Use connection service to create a new connection. ArrayList newConns = _dtsConnectionService.CreateConnection(Connection_Type); if (newConns.Count > 0) { // A new connection has been created, so populate and select ConnectionManager newConn = (ConnectionManager)newConns[0]; PopulateConnectionsCombo(comboxBox, Connection_Type, newConn.Name); } else { // Create connection has been cancelled comboxBox.SelectedIndex = -1; } } // An connection has been selected. Verify it exists and update component. if (_connections.Contains(comboxBox.Text)) { // Get the selected connection ConnectionManager connectionManager = _connections[comboxBox.Text]; // Save selected connection _dtsComponentMetaData.RuntimeConnectionCollection[0].ConnectionManagerID = _connections[comboxBox.Text].ID; _dtsComponentMetaData.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.GetExtendedInterface(_connections[comboxBox.Text]); } }
/// <summary> /// New Button to create a new connection /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnNewConnectionManager_Click(object sender, EventArgs e) { System.Collections.ArrayList created = connectionService.CreateConnection("CRMSSIS"); foreach (ConnectionManager cm in created) { var item = new Item(cm.Name, cm.ID); cbConnectionList.Items.Insert(0, item); } }
private void btnNewConnectionManager_Click(object sender, EventArgs e) { System.Collections.ArrayList created = connectionService.CreateConnection("RABBITMQ"); foreach (ConnectionManager cm in created) { var item = new ConnectionManagerItem() { Name = cm.Name, ConnManager = cm.InnerObject as RabbitMQConnectionManager.RabbitMQConnectionManager, ID = cm.ID }; cbConnectionList.Items.Insert(0, item); } }
/// <summary> /// Creates a new connectiionManager /// </summary> /// <param name="sender">event sender</param> /// <param name="e">event arguments</param> private void btnNewConMgr_Click(object sender, EventArgs e) { IDtsConnectionService connectionService = (IDtsConnectionService)ServiceProvider.GetService(typeof(IDtsConnectionService)); ArrayList newConnections = connectionService.CreateConnection("ADO.NET"); foreach (ConnectionManager connMgr in newConnections) { if (connMgr.CreationName.StartsWith("ADO.NET")) { _connectionManagerList.Add(connMgr); cmbConMgr.SelectedItem = connMgr; } } }
private void btnNewConnectionManager_Click(object sender, EventArgs e) { System.Collections.ArrayList created = connectionService.CreateConnection(Constants.HDFS_CONNECTION_MANAGER); foreach (ConnectionManager cm in created) { var item = new ConnectionManagerItem() { Name = cm.Name, ConnManager = cm.InnerObject as HDFSConnectionManager.HDFSConnectionManager, ID = cm.ID }; cbConnectionList.Items.Insert(0, item); } }
private void IsagConnectionManager_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { IDtsConnectionService connectionService = (IDtsConnectionService)ServiceProvider.GetService(typeof(IDtsConnectionService)); ArrayList newConnections = connectionService.CreateConnection("ADO.NET"); foreach (ConnectionManager connMgr in newConnections) { if (connMgr.CreationName.StartsWith("ADO.NET")) { _connectionManagerList.Add(connMgr); this.DataBind(); this.Text = connMgr.Name; } } }
private void connectionComboBox_SelectedIndexChanged(object sender, EventArgs e) { // Special case: the <New...> item on the combo box causes us to try to create a new connection manager. if ((string)connectionComboBox.SelectedItem == "New connection") { // Fetch the IDtsConnectionService. It provides facilities to present the user with // a new connection dialog, so they don't need to exit the (modal) UI to create one. IDtsConnectionService connService = (IDtsConnectionService)serviceProvider_.GetService(typeof(IDtsConnectionService)); System.Collections.ArrayList created = connService.CreateConnection("ADO.NET:SQL"); // CreateConnection() returns back a list of connections that were created -- go ahead // and update our list with those new items. foreach (ConnectionManager cm in created) { connectionComboBox.Items.Insert(0, cm.Name); } // If we created an item, we select it in the combo box, otherwise, clear the selection entirely. if (created.Count > 0) { connectionComboBox.SelectedIndex = 0; } else { connectionComboBox.SelectedIndex = -1; } } // No matter what, we set the current connection manager to the chosen item if it's real. if (connections_.Contains(connectionComboBox.SelectedItem)) { this.component_.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(connections_[connectionComboBox.SelectedItem]); this.component_.RuntimeConnectionCollection[0].ConnectionManagerID = connections_[connectionComboBox.SelectedItem].ID; } needsNewMetaData_ = true; }