SourceGrid.Position.Equals C# (CSharp) Method

Equals() public method

public Equals ( Position p_Position ) : bool
p_Position Position
return bool
        public bool Equals(Position p_Position)
        {
            return (m_Col == p_Position.m_Col && m_Row == p_Position.m_Row);
        }

Same methods

Position::Equals ( object obj ) : bool

Usage Example

Beispiel #1
0
        private void EnsureNoSpannedCellsExist(int row, int col, Cells.ICell p_cell)
        {
            var spanRange = new Range(row, col, row + p_cell.RowSpan - 1, col + p_cell.ColumnSpan - 1);
            var ranges    = spannedCellReferences.SpannedRangesCollection.GetRanges(
                spanRange);

            if (ranges.Count == 0)
            {
                return;
            }

            var start = new Position(row, col);

            foreach (var range in ranges)
            {
                if (start.Equals(range.Start) == true)
                {
                    continue;
                }
                Cells.ICell existingSpannedCell = this[range.Start];
                if (existingSpannedCell == null)
                {
                    throw new ArgumentException("internal error. please report this bug to developers");
                }
                throw new OverlappingCellException(string.Format(
                                                       "Given cell at position ({0}, {1}), " +
                                                       "intersects with another cell " +
                                                       "at position ({2}, {3}) '{4}'",
                                                       row, col,
                                                       existingSpannedCell.Row.Index,
                                                       existingSpannedCell.Column.Index,
                                                       existingSpannedCell.DisplayText));
            }
        }
All Usage Examples Of SourceGrid.Position::Equals