GetIsTimeZoneHeaderRequired method

  1. @override
bool GetIsTimeZoneHeaderRequired(
  1. bool isUpdateOperation
)
override
Gets a value indicating whether a time zone SOAP header should be emitted in a CreateItem or UpdateItem request so this item can be property saved or updated. Indicates whether the operation being petrformed is an update operation.

Implementation

@override
bool GetIsTimeZoneHeaderRequired(bool isUpdateOperation) {
  // Starting E14SP2, attachment will be sent along with CreateItem requests.
  // if the attachment used to require the Timezone header, CreateItem request should do so too.
  //
  if (!isUpdateOperation &&
      (this.Service.RequestedServerVersion.index >=
          ExchangeVersion.Exchange2010_SP2.index)) {
    for (ItemAttachment itemAttachment
        in this.Attachments.OfType<ItemAttachment>()) {
      if ((itemAttachment.Item != null) &&
          itemAttachment.Item!
              .GetIsTimeZoneHeaderRequired(false /* isUpdateOperation */)) {
        return true;
      }
    }
  }

  return super.GetIsTimeZoneHeaderRequired(isUpdateOperation);
}