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); }
public void InsertIntoLocation(int targetRow, int targetColumn, InsertShiftDirection shiftDirection) { InsertIntoLocation(Parent, targetRow, targetColumn, shiftDirection); }
public static Excel.XlInsertShiftDirection ConvertInsertShiftDirection(InsertShiftDirection shiftDirection) { return(shiftDirection == InsertShiftDirection.ShiftDown ? Excel.XlInsertShiftDirection.xlShiftDown : Excel.XlInsertShiftDirection.xlShiftToRight); }
public static Excel.XlInsertShiftDirection ConvertInsertShiftDirection(InsertShiftDirection shiftDirection) { return shiftDirection == InsertShiftDirection.ShiftDown ? Excel.XlInsertShiftDirection.xlShiftDown : Excel.XlInsertShiftDirection.xlShiftToRight; }