Exemple #1
0
            public override ReferenceOperationResultType OnRangeMoved(SheetReference source, SheetReference dest)
            {
                Rectangle sourceRect = source.Range;
                Rectangle destRect   = dest.Range;
                int       rowOffset  = destRect.Top - sourceRect.Top;
                int       colOffset  = destRect.Left - sourceRect.Left;
                Rectangle myRect     = _owner.Range;

                bool isContainedInSource = sourceRect.Contains(myRect) & _owner.IsOnSheet(source.Sheet);
                bool isContainedInDest   = destRect.Contains(myRect) & _owner.IsOnSheet(dest.Sheet);

                if (isContainedInSource)
                {
                    // We are in the moved range so we have to adjust
                    _owner.RowIndex    += rowOffset;
                    _owner.ColumnIndex += colOffset;
                    _owner.SetSheetForRangeMove(dest.Sheet);
                    return(ReferenceOperationResultType.Affected);
                }
                if (isContainedInDest)
                {
                    // We are overwritten by the moved range
                    return(ReferenceOperationResultType.Invalidated);
                }
                // We are not affected
                return(ReferenceOperationResultType.NotAffected);
            }
Exemple #2
0
 public override ReferenceOperationResultType OnRangeMoved(SheetReference source, SheetReference dest)
 {
     return(HandleRangeMoved(_owner, source, dest, OnSetMovedRangeResult));
 }
Exemple #3
0
        protected override bool EqualsGridReference(SheetReference @ref)
        {
            var rangeRef = (CellRangeReference)@ref;

            return(_start.EqualsReference(rangeRef._start) & _finish.EqualsReference(rangeRef._finish));
        }
Exemple #4
0
        protected override bool EqualsGridReference(SheetReference @ref)
        {
            var cellRef = (CellReference)@ref;

            return(RowIndex == cellRef.RowIndex & ColumnIndex == cellRef.ColumnIndex);
        }
        protected override bool EqualsGridReference(SheetReference @ref)
        {
            var realRef = (RowColumnReference)@ref;

            return(_start == realRef._start && _finish == realRef._finish);
        }
Exemple #6
0
 protected abstract bool EqualsGridReference(SheetReference @ref);