public void Initialize(TaskHost taskHost, IServiceProvider serviceProvider) { _taskHost = taskHost; IDtsConnectionService cs = serviceProvider.GetService(typeof(IDtsConnectionService)) as IDtsConnectionService; _connections = cs.GetConnections(); }
private void HDFSDestinationUI_Load(object sender, EventArgs e) { var connections = connectionService.GetConnections(); var connectionManagerId = string.Empty; if (metaData.CustomPropertyCollection[Constants.HDFS_PATH_PROPERTY] != null || !string.IsNullOrWhiteSpace(metaData.CustomPropertyCollection[Constants.HDFS_PATH_PROPERTY].Value)) { txtDestinationPath.Text = metaData.CustomPropertyCollection[Constants.HDFS_PATH_PROPERTY].Value; } IDTSVirtualInput100 vInput = metaData.InputCollection[0].GetVirtualInput(); Dictionary <string, int> columnLineage = new Dictionary <string, int>(vInput.VirtualInputColumnCollection.Count); int itemIndex = 0; foreach (IDTSVirtualInputColumn100 item in vInput.VirtualInputColumnCollection) { cbSourceColumns.Items.Add(new SourceColumnItem() { Name = item.Name.Trim(), Index = itemIndex++, ColumnInfo = item }); columnLineage.Add(item.Name, item.LineageID); } var currentConnectionManager = this.metaData.RuntimeConnectionCollection[0]; if (currentConnectionManager != null) { connectionManagerId = currentConnectionManager.ConnectionManagerID; } int diff = 0; for (int i = 0; i < connections.Count; i++) { var conn = connections[i].InnerObject as HDFSConnectionManager.HDFSConnectionManager; if (conn != null) { var item = new ConnectionManagerItem() { Name = connections[i].Name, ConnManager = conn, ID = connections[i].ID }; cbConnectionList.Items.Add(item); if (connections[i].ID.Equals(connectionManagerId)) { cbConnectionList.SelectedIndex = i - diff; } } else { diff++; } } }
public void Initialize(TaskHost taskHost, IServiceProvider serviceProvider) { this.taskHost = taskHost; this.serviceProvider = serviceProvider; IDtsConnectionService connectionService = serviceProvider.GetService(typeof(IDtsConnectionService)) as IDtsConnectionService; this.connections = connectionService.GetConnections(); }
public void Initialize(TaskHost taskHost, IServiceProvider serviceProvider) { //throw new NotImplementedException(); //System.Windows.Forms.MessageBox.Show("Initialize"); this.taskHost = taskHost; IDtsConnectionService cs = serviceProvider.GetService(typeof(IDtsConnectionService)) as IDtsConnectionService; this.connections = cs.GetConnections(); return; }
private void PopulateConnectionsCombo(ComboBox comboBox, string connectionType, string selectedItem) { // Prepare combo box by clearing, and adding the new connection item. comboBox.Items.Clear(); comboBox.Items.Add("<New connection...>"); // Enumerate connections, but for type supported. foreach (ConnectionManager connectionManager in _dtsConnectionService.GetConnections()) { comboBox.Items.Add(connectionManager.Name); } // Set currently selected connection comboBox.SelectedItem = selectedItem; }
private void CRMSourceAdapterUIForm_Load(object sender, EventArgs e) { var connections = connectionService.GetConnections(); var FetchXML = metaData.CustomPropertyCollection[0]; oldFetchXML = (string)FetchXML.Value; txtFetchXML.Text = (string)FetchXML.Value; string connectionManagerId = string.Empty; var currentConnectionManager = this.metaData.RuntimeConnectionCollection[0]; if (currentConnectionManager != null) { connectionManagerId = currentConnectionManager.ConnectionManagerID; } for (int i = 0; i < connections.Count; i++) { var conn = connections[i].InnerObject; if (conn != null) { if (conn.GetType().ToString() == "CRMSSIS.CRMConnectionManager.CRMConnectionManager") { var item = new ConnectionManagerItem() { Name = connections[i].Name, ID = connections[i].ID }; cbConnectionList.Items.Add(item); if (connections[i].ID.Equals(connectionManagerId)) { cbConnectionList.SelectedIndex = i; } } } } }
private void RabbitMQSourceUIForm_Load(object sender, EventArgs e) { var connections = connectionService.GetConnections(); var queueName = metaData.CustomPropertyCollection[0]; txtQueueName.Text = queueName.Value; string connectionManagerId = string.Empty; var currentConnectionManager = this.metaData.RuntimeConnectionCollection[0]; if (currentConnectionManager != null) { connectionManagerId = currentConnectionManager.ConnectionManagerID; } for (int i = 0; i < connections.Count; i++) { var conn = connections[i].InnerObject as RabbitMQConnectionManager.RabbitMQConnectionManager; if (conn != null) { var item = new ConnectionManagerItem() { Name = connections[i].Name, ConnManager = conn, ID = connections[i].ID }; cbConnectionList.Items.Add(item); if (connections[i].ID.Equals(connectionManagerId)) { cbConnectionList.SelectedIndex = i; } } } }
private void CRMDestinationAdapterUIForm_Load(object sender, EventArgs e) { btnMappings.Enabled = false; cboWorkflows.Enabled = false; btnRefresh.Enabled = false; btnRefreshWorkflows.Enabled = false; btnRefreshMetadata.Enabled = false; cbEntity.Enabled = false; var connections = connectionService.GetConnections(); string connectionManagerId = string.Empty; var currentConnectionManager = this.metaData.RuntimeConnectionCollection[0]; if (currentConnectionManager != null) { connectionManagerId = currentConnectionManager.ConnectionManagerID; } for (int i = 0; i < connections.Count; i++) { var conn = connections[i].InnerObject; if (conn != null) { if (conn.GetType().ToString() == "CRMSSIS.CRMConnectionManager.CRMConnectionManager") { var item = new Item(connections[i].Name, connections[i].ID); cbConnectionList.Items.Add(item); if (connections[i].ID.Equals(connectionManagerId)) { cbConnectionList.SelectedIndex = i; cbEntity.Enabled = true; } } } } loadCultureInfo(); loadOperationsCombobox(); txtBatchSize.Text = Convert.ToString(this.metaData.CustomPropertyCollection["BatchSize"].Value); // User already selected an Entity if (this.metaData.CustomPropertyCollection["Entity"].Value != null) { btnRefresh.Enabled = true; btnRefreshMetadata.Enabled = true; btnMappings.Enabled = true; Item Entity = (Item)CRMSSIS.CRMCommon.JSONSerialization.Deserialize <Item>(this.metaData.CustomPropertyCollection["Entity"].Value.ToString()); cbEntity.Items.Add(Entity); cbEntity.SelectedIndex = 0; cbEntity.Enabled = false; this.cbEntity.SelectedIndexChanged += new System.EventHandler(this.cbEntity_SelectedIndexChanged); if (this.metaData.CustomPropertyCollection["Mapping"].Value != null) { m = CRMCommon.JSONSerialization.Deserialize <Mapping>(this.metaData.CustomPropertyCollection["Mapping"].Value.ToString()); } // Check if the operation is a workflow, if not lets user add mapping if ((Operations)this.metaData.CustomPropertyCollection["Operation"].Value == Operations.Workflow) { btnRefreshWorkflows.Enabled = true; if (this.metaData.CustomPropertyCollection["Workflow"].Value.ToString() == "") { backgroundWorkerLoadWorkflows.RunWorkerAsync(); cboWorkflows.Enabled = true; } else if (this.metaData.CustomPropertyCollection["Workflow"].Value.ToString() != "") { Item Workflow = (Item)CRMSSIS.CRMCommon.JSONSerialization.Deserialize <Item>(this.metaData.CustomPropertyCollection["Workflow"].Value.ToString()); cboWorkflows.Items.Add(Workflow); cboWorkflows.SelectedIndex = 0; } } } else { if (cbConnectionList.SelectedItem != null) { SetPictureBoxFromResource(pbLoader, "CRMSSIS.CRMDestinationAdapter.loading.gif"); pbLoader.Dock = DockStyle.Fill; btnRefresh.Enabled = true; backgroundWorkerLoadEntities.RunWorkerAsync(); } } cbConnectionList.SelectedIndexChanged += new System.EventHandler(this.cbConnectionList_SelectedIndexChanged); cbOperation.SelectedIndexChanged += new System.EventHandler(this.cbOperation_SelectedIndexChanged); chkErrorFail.CheckedChanged += new System.EventHandler(this.chk_Click); chkIgnoreError.CheckedChanged += new System.EventHandler(this.chk_Click); chkRedirect.CheckedChanged += new System.EventHandler(this.chk_Click); loadErrorHandlingCheckboxes(); }