internal void OnChanged(object sender, GridEventArgsType e, object oParam) { if (this.Changed != null) { this.Changed(sender, e, oParam); } }
private void OnChangeSafe(object sender, GridEventArgsType e, object oParam) { this.m_bIsChange = true; if (this.m_iUpdate <= 0) { bool flag = false; int iOffset = 0; bool flag2 = false; switch (e) { case GridEventArgsType.Resize: { int num2 = (int) oParam; this.m_iDocumentHeight += num2; if (((sender is int) && (((int) sender) < this.m_iActualRowIndex)) && (this.m_vScroll != null)) { this.m_iVScrollPrevValue += num2; this.m_vScroll.Value += num2; } if (this.SetVScrollBar(this.DocumentHeight)) { flag = true; iOffset = this.m_iVScrollPrevValue - this.m_vScroll.Value; flag2 = true; } this.m_rcRows.LastDrawnRow = 0; break; } case GridEventArgsType.Refresh: { RefreshData data = oParam as RefreshData; if (this.m_rHeader != null) { this.m_rHeader.ResetCachedBounds(); } if (this.m_rFooter != null) { this.m_rFooter.ResetCachedBounds(); } if (this.m_rcRows != null) { if ((data != null) && data.ResetBounds) { this.m_rcRows.ResetCachedBounds(data.Template); } this.m_iDocumentHeight = this.m_rcRows.CalculateRowsHeight(); if (this.SetVScrollBar(this.DocumentHeight)) { this.m_rcRows.ResetCachedBounds((data == null) ? null : data.Template); this.m_iDocumentHeight = this.m_rcRows.CalculateRowsHeight(); this.SetVScrollBar(this.DocumentHeight); } } if (this.m_iScrollChange == 0) { this.m_rcRows.LastDrawnRow = 0; } this.SetScrollPos(this.m_iActualRowIndex, -1, this.m_iTopmostRowOffset); break; } case GridEventArgsType.VScroll: flag = true; iOffset = (int) oParam; break; default: this.SetVScrollBarBounds(); break; } if (flag) { this.CalculateFirstRow(iOffset); this.m_iVScrollPrevValue = this.m_vScroll.Value; } if (flag2) { iOffset = 0; } this.SetRedraw(iOffset); base.Invalidate(); } }
private void OnChange(object sender, GridEventArgsType e, object oParam) { if (this.InvokeRequired && (this.OnChangeHandler != null)) { base.Invoke(this.OnChangeHandler, new object[] { sender, e, oParam }); } else { this.OnChangeSafe(sender, e, oParam); } }