private void addButton_Click(object sender, EventArgs e)
 {
     int count;
     if (this.selectedColumns.SelectedIndex == -1)
     {
         count = this.selectedColumns.Items.Count;
     }
     else
     {
         count = this.selectedColumns.SelectedIndex + 1;
     }
     if (this.addColumnDialog == null)
     {
         this.addColumnDialog = new FilterAddColumnDialog(this.columnsPrivateCopy, this.liveFilterControl);
         this.addColumnDialog.StartPosition = FormStartPosition.CenterParent;
     }
     this.addColumnDialog.Start(count, false);
     this.addColumnDialog.ShowDialog(this);
 }
 public void OnAddColumn(object sender, EventArgs e)
 {
     try
     {
         DesignerTransaction transaction = (base.Component.Site.GetService(typeof(IDesignerHost)) as IDesignerHost).CreateTransaction("AddColumnTransactionString");
         DialogResult cancel = DialogResult.Cancel;
         FilterAddColumnDialog dialog = new FilterAddColumnDialog(((FilterControl)base.Component).Columns, (FilterControl)base.Component);
         dialog.Start(((FilterControl)base.Component).Columns.Count, true);
         try
         {
             cancel = this.ShowDialog(dialog);
         }
         finally
         {
             if (cancel == DialogResult.OK)
             {
                 transaction.Commit();
             }
             else
             {
                 transaction.Cancel();
             }
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.ToString());
     }
 }