/// <summary> /// Adds new output column to TreeView /// </summary> /// <param name="trvOutputColumns">TreeView to which the OutputColumn should be created</param> /// <param name="creator">OutputColumnCreator to be used for new OutputColumn creaton</param> /// <param name="propertyChangedHandler">PropertyChange EventHandler to be associated with the newly created FormInputColumn</param> public virtual TFormOutputColumn AddOutputColumnT <TFormOutputColumn>(TreeView trvOutputColumns, NewOutputColumnCreator <TFormOutputColumn> creator, PropertyChangedEventHandler o_PropertyChanged) where TFormOutputColumn : FormOutputColumn { TreeNode node = trvOutputColumns.SelectedNode; if (node != null) { if (node.Tag is FormOutputColumn) { node = node.Parent; } FormOutput o = node.Tag as FormOutput; TFormOutputColumn col = creator(o.DTSOutput); col.UIHelper = this; col.PropertyChanged += o_PropertyChanged; TreeNode cn = new TreeNode(col.Name); cn.Name = col.Guid.ToString(); cn.Tag = col; col.AssociatedTreeNode = cn; node.Nodes.Add(cn); trvOutputColumns.SelectedNode = cn; cn.EnsureVisible(); return(col); } else { return(null); } }
/// <summary> /// Adds new output column to TreeView /// </summary> /// <param name="trvOutputColumns">TreeView to which the OutputColumn should be created</param> /// <param name="creator">UiOutputColumnCreator to be used for new OutputColumn creaton</param> /// <param name="propertyChangedHandler">PropertyChange EventHandler to be associated with the newly created FormInputColumn</param> public virtual void AddUIOutputColumn(TreeView trvOutputColumns, NewUiOutputColumnCreator creator, IUIHelper uiHelper, PropertyChangedEventHandler o_PropertyChanged) { TreeNode node = trvOutputColumns.SelectedNode; if (node != null) { if (node.Tag is FormOutputColumn) { node = node.Parent; } FormOutput o = node.Tag as FormOutput; FormOutputColumn col = creator(o.DTSOutput, uiHelper); col.UIHelper = this; col.PropertyChanged += o_PropertyChanged; TreeNode cn = new TreeNode(col.Name); cn.Name = col.Guid.ToString(); cn.Tag = col; col.AssociatedTreeNode = cn; node.Nodes.Add(cn); trvOutputColumns.SelectedNode = cn; cn.EnsureVisible(); } }
/// <summary> /// Removes selected OutputColumn /// </summary> /// <param name="trvOutputColumns">TreeView from which the OutputColumn shoudl be removed</param> public virtual void RemoveOutputColumn(TreeView trvOutputColumns) { TreeNode node = trvOutputColumns.SelectedNode; if (node != null && node.Tag is FormOutputColumn) { TreeNode on = node.Parent; FormOutput o = on.Tag as FormOutput; FormOutputColumn oc = node.Tag as FormOutputColumn; o.DTSOutput.OutputColumnCollection.RemoveObjectByID(oc.ID); //propOutputColumn.SelectedObject = null; on.Nodes.Remove(node); } }
/// <summary> /// Gets List of DataFlow component Outputs encapsulated in the FormOutputClass /// </summary> /// <param name="changeHandler">PropertyChangedEventHandler to be associated with the newly created FormOutput class</param> /// <returns>List of FormOutput</returns> public List <FormOutput> GetFormOutputs(PropertyChangedEventHandler changeHandler) { List <FormOutput> outputs = new List <FormOutput>(); if (ComponentMetadata != null) { for (int i = 0; i < ComponentMetadata.OutputCollection.Count; i++) { IDTSOutput o = ComponentMetadata.OutputCollection[i]; FormOutput fo = new FormOutput(o); fo.Index = i; fo.PropertyChanged += changeHandler; outputs.Add(fo); } } return(outputs); }