Provides data for a TableModel's RowAdded and RowRemoved events
Inheritance: System.EventArgs
コード例 #1
0
ファイル: TableModel.cs プロジェクト: zhuangyy/Motion
        /// <summary>
        /// Raises the RowRemoved event
        /// </summary>
        /// <param name="e">A TableModelEventArgs that contains the event data</param>
        protected internal virtual void OnRowRemoved(TableModelEventArgs e)
        {
            if (e.Row != null && e.Row.TableModel == this)
            {
                e.Row.InternalTableModel = null;
                e.Row.InternalIndex = -1;

                if (e.Row.AnyCellsSelected)
                {
                    e.Row.ClearSelection();

                    this.Selections.RemoveRow(e.Row);
                }
            }

            this.UpdateRowIndicies(e.RowFromIndex);

            if (this.CanRaiseEvents)
            {
                if (this.Table != null)
                {
                    this.Table.OnRowRemoved(e);
                }

                if (RowRemoved != null)
                {
                    RowRemoved(this, e);
                }
            }
        }
コード例 #2
0
ファイル: TableModel.cs プロジェクト: zhuangyy/Motion
        /// <summary>
        /// Raises the RowAdded event
        /// </summary>
        /// <param name="e">A TableModelEventArgs that contains the event data</param>
        protected internal virtual void OnRowAdded(TableModelEventArgs e)
        {
            e.Row.InternalTableModel = this;
            e.Row.InternalIndex = e.RowFromIndex;
            e.Row.ClearSelection();

            this.UpdateRowIndicies(e.RowFromIndex);

            if (this.CanRaiseEvents)
            {
                if (this.Table != null)
                {
                    this.Table.OnRowAdded(e);
                }

                if (RowAdded != null)
                {
                    RowAdded(this, e);
                }
            }
        }
コード例 #3
0
ファイル: Table.cs プロジェクト: zhuangyy/Motion
 /// <summary>
 /// Raises the RowAdded event
 /// </summary>
 /// <param name="e">A TableModelEventArgs that contains the event data</param>
 protected internal virtual void OnRowAdded(TableModelEventArgs e)
 {
     // tunned by Kosmokrat Hismoom on 9 jan 2006
     if (this.CanRaiseEvents)
     {
         this.PerformLayout();
         Rectangle rowRect = this.RowRect(e.Row.Index);
         if ((rowRect != Rectangle.Empty)
             && (rowRect.IntersectsWith(this.CellDataRect)))
         {
             this.Invalidate();
         }
         if (RowAdded != null)
         {
             RowAdded(e.TableModel, e);
         }
     }
 }
コード例 #4
0
ファイル: Table.cs プロジェクト: zhuangyy/Motion
        /// <summary>
        /// Raises the RowRemoved event
        /// </summary>
        /// <param name="e">A TableModelEventArgs that contains the event data</param>
        protected internal virtual void OnRowRemoved(TableModelEventArgs e)
        {
            if (this.CanRaiseEvents)
            {
                this.PerformLayout();
                this.Invalidate();

                // Removing a parent row should also remove the child rows...
                // Fix (Colby Dillion)
                if (e.Row != null && e.Row.SubRows != null)
                {
                    foreach (Row row in e.Row.SubRows)
                    {
                        e.TableModel.Rows.Remove(row);
                    }
                }

                if (RowRemoved != null)
                {
                    RowRemoved(e.TableModel, e);
                }
            }
        }
コード例 #5
0
ファイル: RowCollection.cs プロジェクト: zhuangyy/Motion
 /// <summary>
 /// Raises the RowRemoved event
 /// </summary>
 /// <param name="e">A TableModelEventArgs that contains the event data</param>
 protected virtual void OnRowRemoved(TableModelEventArgs e)
 {
     this.owner.OnRowRemoved(e);
 }