Beispiel #1
0
        /// <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();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Gets List of OutputColumns of Particular OuputID encapsulated in the FormOutputColumn class
        /// </summary>
        /// <param name="outputID">ID of the Output to get OutputColumns</param>
        /// <param name="creator">OutputColumnCreator to be used for creation of the FormInputColumn instances</param>
        /// <param name="changedHandler">PropertyChangedEventHanled to be associated with the newly created FormInputColumn objects</param>
        /// <returns>List of FomrInputColumn</returns>
        public virtual List <FormOutputColumn> GetFormOutputColumns(int outputID, OutputColumnCreator creator, PropertyChangedEventHandler changedHandler)
        {
            List <FormOutputColumn> outputCols = new List <FormOutputColumn>();
            IDTSOutput output = ComponentMetadata.OutputCollection.GetObjectByID(outputID);

            if (output != null && creator != null)
            {
                for (int i = 0; i < output.OutputColumnCollection.Count; i++)
                {
                    IDTSOutputColumn col = output.OutputColumnCollection[i];

                    FormOutputColumn oCol = creator(col);
                    oCol.UIHelper = this;
                    oCol.OutputID = outputID;

                    oCol.Index = i;

                    if (changedHandler != null)
                    {
                        oCol.PropertyChanged += changedHandler;
                    }

                    outputCols.Add(oCol);
                }
            }

            return(outputCols);
        }
Beispiel #3
0
        /// <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);
            }
        }