예제 #1
0
 public void Delete(DeleteShiftDirection deleteShiftDirection)
 {
     AssertNotDisposed();
     Excel.Range _range = _GetRange();
     _range.Delete(EnumConvert.ConvertDeleteShiftDirection(deleteShiftDirection));
     Marshal.ReleaseComObject(_range);
 }
예제 #2
0
        /// <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());
        }
예제 #3
0
 public static Excel.XlDeleteShiftDirection ConvertDeleteShiftDirection(DeleteShiftDirection deleteDirection)
 {
     return(deleteDirection == DeleteShiftDirection.ShiftUp
         ? Excel.XlDeleteShiftDirection.xlShiftUp
         : Excel.XlDeleteShiftDirection.xlShiftToLeft);
 }
예제 #4
0
 public void Delete(DeleteShiftDirection deleteShiftDirection)
 {
     AssertNotDisposed();
     Excel.Range _range = _GetRange();
     _range.Delete(EnumConvert.ConvertDeleteShiftDirection(deleteShiftDirection));
     Marshal.ReleaseComObject(_range);
 }
예제 #5
0
 public static Excel.XlDeleteShiftDirection ConvertDeleteShiftDirection(DeleteShiftDirection deleteDirection)
 {
     return deleteDirection == DeleteShiftDirection.ShiftUp
         ? Excel.XlDeleteShiftDirection.xlShiftUp
         : Excel.XlDeleteShiftDirection.xlShiftToLeft;
 }