Esempio n. 1
0
        public void InsertIntoLocation(IWorksheet targetWorksheet, int targetRow, int targetColumn,
                                       InsertShiftDirection shiftDirection)
        {
            AssertNotDisposed();
            var targetRange = targetWorksheet.GetRange(targetRow, targetColumn, targetRow + EndRow - StartRow,
                                                       targetColumn + EndColumn - StartColumn) as Range;

            if (targetRange == null)
            {
                throw new InvalidOperationException("Implementation of this method depends on another Office Interop wrapper.");
            }

            Excel.Range _range       = _GetRange();
            Excel.Range _targetRange = targetRange._GetRange();
            lock (Synchronization.ClipboardSyncRoot)
            {
                _targetRange.Insert(EnumConvert.ConvertInsertShiftDirection(shiftDirection), _range.Copy());
            }

            Marshal.ReleaseComObject(_targetRange);
            Marshal.ReleaseComObject(_range);
        }
Esempio n. 2
0
 public void InsertIntoLocation(int targetRow, int targetColumn, InsertShiftDirection shiftDirection)
 {
     InsertIntoLocation(Parent, targetRow, targetColumn, shiftDirection);
 }
Esempio n. 3
0
 public void InsertIntoLocation(int targetRow, int targetColumn, InsertShiftDirection shiftDirection)
 {
     InsertIntoLocation(Parent, targetRow, targetColumn, shiftDirection);
 }
Esempio n. 4
0
        public void InsertIntoLocation(IWorksheet targetWorksheet, int targetRow, int targetColumn,
            InsertShiftDirection shiftDirection)
        {
            AssertNotDisposed();
            var targetRange = targetWorksheet.GetRange(targetRow, targetColumn, targetRow + EndRow - StartRow,
                targetColumn + EndColumn - StartColumn) as Range;
            if (targetRange == null)
            {
                throw new InvalidOperationException("Implementation of this method depends on another Office Interop wrapper.");
            }

            Excel.Range _range = _GetRange();
            Excel.Range _targetRange = targetRange._GetRange();
            lock (Synchronization.ClipboardSyncRoot)
            {
                _targetRange.Insert(EnumConvert.ConvertInsertShiftDirection(shiftDirection), _range.Copy());
            }

            Marshal.ReleaseComObject(_targetRange);
            Marshal.ReleaseComObject(_range);
        }
Esempio n. 5
0
 public static Excel.XlInsertShiftDirection ConvertInsertShiftDirection(InsertShiftDirection shiftDirection)
 {
     return(shiftDirection == InsertShiftDirection.ShiftDown
         ? Excel.XlInsertShiftDirection.xlShiftDown
         : Excel.XlInsertShiftDirection.xlShiftToRight);
 }
Esempio n. 6
0
 public static Excel.XlInsertShiftDirection ConvertInsertShiftDirection(InsertShiftDirection shiftDirection)
 {
     return shiftDirection == InsertShiftDirection.ShiftDown
         ? Excel.XlInsertShiftDirection.xlShiftDown
         : Excel.XlInsertShiftDirection.xlShiftToRight;
 }