ValidatePropertyVersion static method
void
ValidatePropertyVersion(
- ExchangeService service,
- ExchangeVersion minimumServerVersion,
- String propertyName
Implementation
// static void ValidateParamCollection(Iterable collection, String paramName)
// {
// ValidateParam(collection, paramName);
//
// int count = 0;
//
// for (Object obj in collection)
// {
// try
// {
// ValidateParam(obj, """string.Format("collection[{0}]", count)""");
// }
// on ArgumentException catch( e)
// {
// throw new ArgumentException("""
// string.Format("The element at position {0} is invalid", count),
// paramName,
// e""");
// }
//
// count++;
// }
//
// if (count == 0)
// {
// throw new ArgumentException(""""Strings.CollectionIsEmpty", paramName""");
// }
// }
// /// <summary>
// /// Validates service object version against the request version.
// /// </summary>
// /// <param name="serviceObject">The service object.</param>
// /// <param name="requestVersion">The request version.</param>
// /// <exception cref="ServiceVersionException">Raised if this service object type requires a later version of Exchange.</exception>
// static void ValidateServiceObjectVersion(ServiceObject serviceObject, ExchangeVersion requestVersion)
// {
// ExchangeVersion minimumRequiredServerVersion = serviceObject.GetMinimumRequiredServerVersion();
//
// if (requestVersion < minimumRequiredServerVersion)
// {
// throw new ServiceVersionException(
// string.Format(
// Strings.ObjectTypeIncompatibleWithRequestVersion,
// serviceObject.GetType().Name,
// minimumRequiredServerVersion));
// }
// }
/// <summary>
/// Validates property version against the request version.
/// </summary>
/// <param name="service">The Exchange service.</param>
/// <param name="minimumServerVersion">The minimum server version that supports the property.</param>
/// <param name="propertyName">Name of the property.</param>
static void ValidatePropertyVersion(ExchangeService service,
ExchangeVersion minimumServerVersion, String propertyName) {
if (service.RequestedServerVersion.index < minimumServerVersion.index) {
throw new ServiceVersionException("""string.Format(
Strings.PropertyIncompatibleWithRequestVersion,
propertyName,
minimumServerVersion)""");
}
}