コード例 #1
0
ファイル: ISOutputColumn.cs プロジェクト: ihocan/Pegasus
 public ISOutputColumn(ISPipelineComponent parentComponent, string outputName, string outputColumnname,
                       RowDisposition errorRowDisposition,
                       RowDisposition truncationRowDisposition)
     : this(parentComponent, outputName, outputColumnname)
 {
     OutputColumn.ErrorRowDisposition      = DtsUtility.EnumAToEnumB <RowDisposition, DTSRowDisposition>(errorRowDisposition);
     OutputColumn.TruncationRowDisposition = DtsUtility.EnumAToEnumB <RowDisposition, DTSRowDisposition>(truncationRowDisposition);
 }
コード例 #2
0
ファイル: ISOutput.cs プロジェクト: ihocan/Pegasus
        /// <summary>
        /// First check if an Output with the given name exists on the Component.
        ///     If it exists, then assign that output to the Output property
        ///     If it does not exist:
        ///         Check if more outputs can be added or not.
        ///         If more outputs can be added, then add a new output
        ///         If more outputs cannot be added, then assign the first (non error ) output in the component's collection to the Output property
        /// </summary>
        /// <param name="parentComponent"></param>
        /// <param name="name"></param>
        public ISOutput(ISPipelineComponent parentComponent, string name, int referenceOutputIndex = 0, InsertPlacement beforeOrAfter = InsertPlacement.IP_BEFORE)
        {
            ParentComponent = parentComponent;

            bool outputExists = false;

            for (int i = 0; i < ParentComponent.ComponentMetaData.OutputCollection.Count; i++)
            {
                if (ParentComponent.ComponentMetaData.OutputCollection[i].Name == name)
                {
                    Output       = ParentComponent.ComponentMetaData.OutputCollection[i];
                    outputExists = true;
                }
            }

            //  check if more outputs can be added
            int existingOutputCount = parentComponent.ComponentMetaData.OutputCollection.Count;

            if (ParentComponent._numberOfOutputsAllowed == -1)
            {
                if (!(outputExists))
                {
                    Output = parentComponent.DesignTimeComponent.InsertOutput(DtsUtility.EnumAToEnumB <InsertPlacement, DTSInsertPlacement>(beforeOrAfter), ParentComponent.GetOutputFromIndex(referenceOutputIndex).ID);
                    Name   = name;
                }
            }
            else
            {
                if (existingOutputCount < parentComponent._numberOfOutputsAllowed)
                {
                    if (!(outputExists))
                    {
                        Output = parentComponent.DesignTimeComponent.InsertOutput(DTSInsertPlacement.IP_BEFORE, ParentComponent.GetOutputFromIndex(referenceOutputIndex).ID);
                        Name   = name;
                    }
                }
                else
                {
                    if (!outputExists)
                    {
                        Console.WriteLine("WARN::: Only {1} output(s) are allowed. A new output with the name '{0}' cannot be added. Therefore, the name '{0}' is assigned to the first non error output in the collection", name, existingOutputCount.ToString());
                        Output = parentComponent.ComponentMetaData.OutputCollection[0];
                        Name   = name;
                    }
                }
            }
        }
コード例 #3
0
        internal IDTSInputColumn100 SetInputColumnDTSUsageType(IDTSInput100 input, string columnName, UsageType dtsUsageType)
        {
            //  keep track of hte columns whose usage type is set to ut_readwrite...for these cols, we want to prevent a change to ut_readonly
            if (dtsUsageType == UsageType.UT_READWRITE)
            {
                _readWriteCols.Add(columnName);
            }

            IDTSVirtualInput100 virtualInput = input.GetVirtualInput();
            IDTSInputColumn100  inputColumn  = DesignTimeComponent.SetUsageType(
                input.ID,
                virtualInput,
                virtualInput.VirtualInputColumnCollection[columnName].LineageID,
                DtsUtility.EnumAToEnumB <UsageType, DTSUsageType>(dtsUsageType)
                );

            return(inputColumn);
        }
コード例 #4
0
ファイル: ISInput.cs プロジェクト: samskolli/Pegasus
        public ISInput(ISPipelineComponent parentComponent, string inputName)
        {
            ParentComponent = parentComponent;

            bool inputExists = false;

            for (int i = 0; i < ParentComponent.ComponentMetaData.InputCollection.Count; i++)
            {
                if (ParentComponent.ComponentMetaData.InputCollection[i].Name == inputName)
                {
                    inputExists = true;
                    Input       = ParentComponent.ComponentMetaData.InputCollection[i];
                }
            }
            if (!(inputExists))
            {
                //Input = ParentComponent.AddInput("after", ParentComponent.GetInputFromIndex(0).Name);
                Input      = ParentComponent.DesignTimeComponent.InsertInput(DtsUtility.EnumAToEnumB <InsertPlacement, DTSInsertPlacement>(InsertPlacement.IP_AFTER), ParentComponent.GetInputFromIndex(ParentComponent.InputCollection_m.Count - 1).ID);
                Input.Name = inputName;
            }
        }
コード例 #5
0
ファイル: ISInput.cs プロジェクト: samskolli/Pegasus
        public List <ISInputColumn> GetColumnCollection()
        {
            List <ISInputColumn> inputColumns = new List <ISInputColumn>();

            foreach (IDTSInputColumn100 outputColumn in Input.InputColumnCollection)
            {
                inputColumns.Add(new ISInputColumn(ParentComponent, Input.Name, outputColumn.Name, DtsUtility.EnumAToEnumB <DTSUsageType, UsageType>(outputColumn.UsageType)));
            }
            return(inputColumns);
        }