Exemplo n.º 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);
            }
Exemplo n.º 2
0
 public override ReferenceOperationResultType OnRangeMoved(SheetReference source, SheetReference dest)
 {
     return(HandleRangeMoved(_owner, source, dest, OnSetMovedRangeResult));
 }
Exemplo n.º 3
0
        protected override bool EqualsGridReference(SheetReference @ref)
        {
            var rangeRef = (CellRangeReference)@ref;

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

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

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