Esempio n. 1
0
        void choosecolumnspage_DeleteInputOutputColumns(object sender, SetInputOutputColumnsArgs args)
        {
            Debug.Assert(args.VirtualColumn != null, "Invalid arguments passed from the UI");

            this.ClearErrors();

            try
            {
                IDTSInput100 input = this.ComponentMetadata.InputCollection[0];
                IDTSVirtualInputColumn100 virtualInputColumn = args.VirtualColumn.Tag as IDTSVirtualInputColumn100;

                if (virtualInputColumn == null)
                {
                    throw new InvalidOperationException("The UI is in an inconsistent state: Passed argument is not valid.");
                }

                int lineageID = virtualInputColumn.LineageID;

                this.DesigntimeComponent.SetUsageType(input.ID, this.VirtualInput, lineageID, DTSUsageType.UT_IGNORED);
            }
            catch (Exception ex)
            {
                this.ReportErrors(ex);
                args.CancelAction = true;
            }
        }
 private void SetColumns(SetInputOutputColumnsArgs args)
 {
     if (this.SetInputOutputColumns != null)
     {
         this.SetInputOutputColumns(this, args);
         if (!args.CancelAction)
         {
             this.dataGridViewSelectedColumns.Rows.Add();
             this.SetSelectedColumnsRow(args.GeneratedColumns,
                                        this.dataGridViewSelectedColumns.Rows[this.dataGridViewSelectedColumns.Rows.Count - 1]);
         }
     }
 }
        private void DeleteColumns(SetInputOutputColumnsArgs args)
        {
            if (this.DeleteInputOutputColumns != null)
            {
                this.DeleteInputOutputColumns(this, args);
            }

            if (!args.CancelAction)
            {
                foreach (DataGridViewRow row in this.dataGridViewSelectedColumns.Rows)
                {
                    //look for the row
                    if (row.Cells[this.gridTextBoxInputColumn.Index].Value.ToString() == args.VirtualColumn.ToString())
                    {
                        //romove it
                        this.dataGridViewSelectedColumns.Rows.Remove(row);
                        break;
                    }
                }
            }
        }
        private void dataGridViewAvailableColumns_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (this.isLoading)
            {
                return;
            }

            if (e.ColumnIndex == this.gridCheckBoxAvailableColumns.Index && e.RowIndex >= 0)
            {
                DataGridViewCheckBoxCell checkBoxCell = this.dataGridViewAvailableColumns.CurrentCell as DataGridViewCheckBoxCell;
                DataGridViewCell         columnCell   = this.dataGridViewAvailableColumns.Rows[e.RowIndex].Cells[this.gridTextBoxAvailableColumns.Index];

                SetInputOutputColumnsArgs args = new SetInputOutputColumnsArgs();
                args.VirtualColumn = new DataFlowElement(columnCell.Value.ToString(), columnCell.Tag);

                bool bAddColumn = (bool)checkBoxCell.Value;

                // If we're using the select all button, override the value
                // with the current state of the box.
                if (bSelectAllClicked)
                {
                    bAddColumn = bSelectAllState;
                }

                if (bAddColumn)
                {
                    this.SetColumns(args);
                }
                else
                {
                    this.DeleteColumns(args);
                }

                // Mark the select all check box as indeterminate
                if (!bSelectAllClicked)
                {
                    chkSelectAll.CheckState = CheckState.Indeterminate;
                }
            }
        }
Esempio n. 5
0
        void choosecolumnspage_DeleteInputOutputColumns(object sender, SetInputOutputColumnsArgs args)
        {
            Debug.Assert(args.VirtualColumn != null, "Invalid arguments passed from the UI");

            this.ClearErrors();

            try
            {
                IDTSInput100 input = this.ComponentMetadata.InputCollection[0];
                IDTSVirtualInputColumn100 virtualInputColumn = args.VirtualColumn.Tag as IDTSVirtualInputColumn100;

                if (virtualInputColumn == null)
                {
                    throw new InvalidOperationException("The UI is in an inconsistent state: Passed argument is not valid.");
                }

                int lineageID = virtualInputColumn.LineageID;

                this.DesigntimeComponent.SetUsageType(input.ID, this.VirtualInput, lineageID, DTSUsageType.UT_IGNORED);
            }
            catch (Exception ex)
            {
                this.ReportErrors(ex);
                args.CancelAction = true;
            }
        }
 private void SetColumns(SetInputOutputColumnsArgs args)
 {
     if (this.SetInputOutputColumns != null)
     {
         this.SetInputOutputColumns(this, args);
         if (!args.CancelAction)
         {
             this.dataGridViewSelectedColumns.Rows.Add();
             this.SetSelectedColumnsRow(args.GeneratedColumns,
                 this.dataGridViewSelectedColumns.Rows[this.dataGridViewSelectedColumns.Rows.Count - 1]);
         }
     }
 }
        private void dataGridViewAvailableColumns_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (this.isLoading)
            {
                return;
            }

            if (e.ColumnIndex == this.gridCheckBoxAvailableColumns.Index && e.RowIndex >= 0)
            {
                DataGridViewCheckBoxCell checkBoxCell = this.dataGridViewAvailableColumns.CurrentCell as DataGridViewCheckBoxCell;
                DataGridViewCell columnCell = this.dataGridViewAvailableColumns.Rows[e.RowIndex].Cells[this.gridTextBoxAvailableColumns.Index];

                SetInputOutputColumnsArgs args = new SetInputOutputColumnsArgs();
                args.VirtualColumn = new DataFlowElement(columnCell.Value.ToString(), columnCell.Tag);

                bool bAddColumn = (bool)checkBoxCell.Value;

                // If we're using the select all button, override the value
                // with the current state of the box.
                if (bSelectAllClicked)
                {
                    bAddColumn = bSelectAllState;
                }

                if (bAddColumn)
                {
                    this.SetColumns(args);
                }
                else
                {
                    this.DeleteColumns(args);
                }

                // Mark the select all check box as indeterminate
                if (!bSelectAllClicked)
                {
                    chkSelectAll.CheckState = CheckState.Indeterminate;
                }
            }
        }
        private void DeleteColumns(SetInputOutputColumnsArgs args)
        {
            if (this.DeleteInputOutputColumns != null)
            {
                this.DeleteInputOutputColumns(this, args);
            }

            if (!args.CancelAction)
            {
                foreach (DataGridViewRow row in this.dataGridViewSelectedColumns.Rows)
                {
                    //look for the row
                    if (row.Cells[this.gridTextBoxInputColumn.Index].Value.ToString() == args.VirtualColumn.ToString())
                    {
                        //romove it
                        this.dataGridViewSelectedColumns.Rows.Remove(row);
                        break;
                    }
                }
            }
        }