//Dissallow DT_NTEXT, DT_TEXT and DT_IMAGE data types. public override bool CheckColumnForInputValidity(IDTSVirtualInput vInput, IDTSInput input, FormInputColumn icol) { bool validForInput = false; var dt = icol.DTSVirtualColumn.DataType; if (dt == DataType.DT_NTEXT || dt == DataType.DT_TEXT || dt == DataType.DT_IMAGE) { validForInput = false; } else { if (icol.DTSInputColumn != null) { //IDTSCustomProperty nullCol = icol.DTSInputColumn.CustomPropertyCollection[Resources.LookupErrorAggIsNullColumnName]; //bool isNullCol = (bool)nullCol.Value; IDTSCustomProperty keyCol = icol.DTSInputColumn.CustomPropertyCollection[Resources.LookupErrorAggIsKeyColumnName]; bool isKeyCol = (bool)keyCol.Value; if (!isKeyCol) { DesignTimeComponent.SetUsageType(input.ID, vInput, icol.LineageID, DTSUsageType.UT_IGNORED); icol.DTSInputColumn = null; } } validForInput = true; } return(validForInput); }
public void SelectLookupInputColumn(System.Windows.Forms.CheckedListBox clbInputColumns, System.Windows.Forms.ListBox lbSelectedItems, int checkedIndex, System.Windows.Forms.CheckState state, int nullColumnLineageId) { FormInputColumn icol = clbInputColumns.Items[checkedIndex] as FormInputColumn; IDTSInput input = ComponentMetadata.InputCollection[0]; if (icol != null) { if (state == CheckState.Checked) { DesignTimeComponent.SetUsageType(input.ID, VirtualInput, icol.LineageID, DTSUsageType.UT_READONLY); IDTSInputColumn inputCol = input.InputColumnCollection.GetInputColumnByLineageID(icol.LineageID); IDTSCustomProperty keyCol = inputCol.CustomPropertyCollection[Resources.LookupErrorAggIsKeyColumnName]; keyCol.Value = true; icol.DTSInputColumn = inputCol; if (lbSelectedItems != null && !lbSelectedItems.Items.Contains(icol)) { int sortOrder = 0; if (lbSelectedItems.Items.Count > 0) { FormInputColumn lastCol = lbSelectedItems.Items[lbSelectedItems.Items.Count - 1] as FormInputColumn; sortOrder = lastCol.SortOrder; } icol.SortOrder = sortOrder + 1; lbSelectedItems.Items.Add(icol); } } else { bool isInput = false; if (icol.DTSInputColumn != null) { IDTSCustomProperty prop = icol.DTSInputColumn.CustomPropertyCollection[Resources.LookupErrorAggIsNullColumnName]; isInput = (bool)prop.Value; IDTSCustomProperty keyCol = icol.DTSInputColumn.CustomPropertyCollection[Resources.LookupErrorAggIsKeyColumnName]; keyCol.Value = false; } if (!isInput) { DesignTimeComponent.SetUsageType(input.ID, VirtualInput, icol.LineageID, DTSUsageType.UT_IGNORED); icol.DTSInputColumn = null; } if (lbSelectedItems != null && lbSelectedItems.Items.Contains(icol)) { lbSelectedItems.Items.Remove(icol); } } } }
/// <summary> /// Selexts an InputColumn (to become available in the input buffer) /// </summary> /// <param name="lineageID">LineageID of the InputColumn</param> /// <param name="isSelected">Selection Status of the Column</param> public IDTSInputColumn SelectInputColumn(int lineageID, bool selected) { IDTSInputColumn icol = null; if (Input != null) { DTSUsageType usageType = selected ? DTSUsageType.UT_READONLY : DTSUsageType.UT_IGNORED; icol = DesignTimeComponent.SetUsageType(Input.ID, VirtualInput, lineageID, usageType); } return(icol); }
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); }
/// <summary> /// Selects an InputColumn (to become available in the input buffer) /// </summary> /// <param name="clbInputColumns">CheckedListbox with InputColumns</param> /// <param name="lbSelectedItems">ListBox with Selected InputColumns</param> /// <param name="checkedIndex">Index of the Item being checked</param> /// <param name="state">CheckState of the item being checkd</param> public virtual void SelectInputColumn(CheckedListBox clbInputColumns, ListBox lbSelectedItems, int checkedIndex, CheckState state) { FormInputColumn icol = clbInputColumns.Items[checkedIndex] as FormInputColumn; IDTSInput input = ComponentMetadata.InputCollection[0]; if (icol != null) { if (state == CheckState.Checked) { DesignTimeComponent.SetUsageType(input.ID, VirtualInput, icol.LineageID, DTSUsageType.UT_READONLY); IDTSInputColumn inputCol = input.InputColumnCollection.GetInputColumnByLineageID(icol.LineageID); icol.DTSInputColumn = inputCol; if (lbSelectedItems != null && !lbSelectedItems.Items.Contains(icol)) { int sortOrder = 0; if (lbSelectedItems.Items.Count > 0) { FormInputColumn lastCol = lbSelectedItems.Items[lbSelectedItems.Items.Count - 1] as FormInputColumn; sortOrder = lastCol.SortOrder; } icol.SortOrder = sortOrder + 1; lbSelectedItems.Items.Add(icol); } } else { DesignTimeComponent.SetUsageType(input.ID, VirtualInput, icol.LineageID, DTSUsageType.UT_IGNORED); icol.DTSInputColumn = null; if (lbSelectedItems != null && lbSelectedItems.Items.Contains(icol)) { lbSelectedItems.Items.Remove(icol); } } } }