Validate method

  1. @override
void Validate()
override
Gets a value indicating whether the TimeZoneContext SOAP header should be emitted. Validates the request.

Implementation

//@override
//        bool EmitTimeZoneHeader
//        {
//            get
//            {
//                for (Item item in this.Items)
//                {
//                    if (item.GetIsTimeZoneHeaderRequired(true /* isUpdateOperation */))
//                    {
//                        return true;
//                    }
//                }
//
//                return false;
//            }
//        }

/// <summary>
/// Validates the request.
/// </summary>
@override
void Validate() {
  super.Validate();
  EwsUtilities.ValidateParamCollection(this.Items, "Items");
  for (int i = 0; i < this.Items.length; i++) {
    if ((this.Items[i] == null) || this.Items[i].IsNew) {
      throw new ArgumentException("ItemToUpdateCannotBeNullOrNew($i)");
    }
  }

  if (this.SavedItemsDestinationFolder != null) {
    this
        .SavedItemsDestinationFolder!
        .ValidateExchangeVersion(this.Service.RequestedServerVersion);
  }

  // Validate each item.
  for (Item item in this.Items) {
    item.Validate();
  }

  if (this.SuppressReadReceipts &&
      this.Service.RequestedServerVersion.index <
          ExchangeVersion.Exchange2013.index) {
    throw new ServiceVersionException("""string.Format(
                      Strings.ParameterIncompatibleWithRequestVersion,
                      "SuppressReadReceipts",
                      ExchangeVersion.Exchange2013)""");
  }
}