public void Delete(DeleteShiftDirection deleteShiftDirection) { AssertNotDisposed(); Excel.Range _range = _GetRange(); _range.Delete(EnumConvert.ConvertDeleteShiftDirection(deleteShiftDirection)); Marshal.ReleaseComObject(_range); }
/// <summary> /// Deletes the object. /// </summary> /// <param name="shift">Used only with Range objects. Specifies how to shift cells to replace deleted cells. Can be one of the following DeleteShiftDirection constants: ToLeft or Up. /// If this argument is omitted, Microsoft Excel decides based on the shape of the range.</param> public void Delete(DeleteShiftDirection? shift) { List<object> parms = new List<object>(); if (shift != null) parms.Add(shift.Value); InternalObject.GetType().InvokeMember("Delete", System.Reflection.BindingFlags.InvokeMethod, null, InternalObject, parms.ToArray()); }
public static Excel.XlDeleteShiftDirection ConvertDeleteShiftDirection(DeleteShiftDirection deleteDirection) { return(deleteDirection == DeleteShiftDirection.ShiftUp ? Excel.XlDeleteShiftDirection.xlShiftUp : Excel.XlDeleteShiftDirection.xlShiftToLeft); }
public static Excel.XlDeleteShiftDirection ConvertDeleteShiftDirection(DeleteShiftDirection deleteDirection) { return deleteDirection == DeleteShiftDirection.ShiftUp ? Excel.XlDeleteShiftDirection.xlShiftUp : Excel.XlDeleteShiftDirection.xlShiftToLeft; }