DeleteItem method

Future<void> DeleteItem(
  1. ItemId? itemId,
  2. DeleteMode deleteMode,
  3. SendCancellationsMode? sendCancellationsMode,
  4. AffectedTaskOccurrence? affectedTaskOccurrences,
  5. bool suppressReadReceipts,
)
Deletes an item. Calling this method results in a call to EWS. The Id of the item to delete. The deletion mode. Indicates whether cancellation messages should be sent. Required if the item Id represents an Appointment. Indicates which instance of a recurring task should be deleted. Required if item Id represents a Task. Deletes an item. Calling this method results in a call to EWS. The Id of the item to delete. The deletion mode. Indicates whether cancellation messages should be sent. Required if the item Id represents an Appointment. Indicates which instance of a recurring task should be deleted. Required if item Id represents a Task. Whether to suppress read receipts

Implementation

//        void DeleteItem(
//            ItemId itemId,
//            DeleteMode deleteMode,
//            SendCancellationsMode sendCancellationsMode,
//            AffectedTaskOccurrence affectedTaskOccurrences)
//        {
//            this.DeleteItem(itemId, deleteMode, sendCancellationsMode, affectedTaskOccurrences, false);
//        }

/// <summary>
/// Deletes an item. Calling this method results in a call to EWS.
/// </summary>
/// <param name="itemId">The Id of the item to delete.</param>
/// <param name="deleteMode">The deletion mode.</param>
/// <param name="sendCancellationsMode">Indicates whether cancellation messages should be sent. Required if the item Id represents an Appointment.</param>
/// <param name="affectedTaskOccurrences">Indicates which instance of a recurring task should be deleted. Required if item Id represents a Task.</param>
/// <param name="suppressReadReceipts">Whether to suppress read receipts</param>
Future<void> DeleteItem(
    ItemId? itemId,
    DeleteMode deleteMode,
    SendCancellationsMode? sendCancellationsMode,
    AffectedTaskOccurrence? affectedTaskOccurrences,
    bool suppressReadReceipts) {
  EwsUtilities.ValidateParam(itemId, "itemId");

  return this.InternalDeleteItems(
      [itemId],
      deleteMode,
      sendCancellationsMode,
      affectedTaskOccurrences,
      ServiceErrorHandling.ThrowOnError,
      suppressReadReceipts);
}