public static SelectionRangePoint TryCreateFromCurrent(DataGridContext dataGridContext) { if (dataGridContext == null) { return(null); } var dataGridControl = dataGridContext.DataGridControl; if (dataGridControl == null) { return(null); } var column = dataGridContext.CurrentColumn; int columnIndex = (column != null) ? column.VisiblePosition : -1; var oldPosition = SelectionRangePoint.TryCreateRangePoint(dataGridContext, dataGridContext.CurrentItem, dataGridContext.CurrentItemIndex, columnIndex); if (oldPosition == null) { oldPosition = SelectionRangePoint.TryCreateRangePoint(dataGridContext, dataGridContext.InternalCurrentItem, -1, columnIndex); } return(oldPosition); }
public SelectionRangePoint CreateCopy() { var copy = new SelectionRangePoint(); copy.m_globalIndex = this.m_globalIndex; copy.m_localIndex = this.m_localIndex; copy.Item = this.Item; copy.ColumnIndex = this.ColumnIndex; copy.DataGridContext = this.DataGridContext; return(copy); }
public static SelectionRangePoint TryCreateRangePoint(DataGridContext dataGridContext, object item, int itemIndex, int columnIndex) { if ((dataGridContext == null) || (item == null)) { return(null); } if (!(item is GroupHeaderFooterItem)) { return(new SelectionRangePoint(dataGridContext, item, itemIndex, columnIndex)); } var dataGridControl = dataGridContext.DataGridControl; if ((dataGridControl == null)) { return(null); } var group = dataGridContext.GetGroupFromCollectionViewGroup((( GroupHeaderFooterItem )item).Group); return(SelectionRangePoint.TryCreateRangePoint(group)); }