TryReadElementFromXml method
Implements an implicit conversion between a String representing a primary SMTP address and UserId.
The String representing a primary SMTP address.
Implements an implicit conversion between StandardUser and UserId.
The standard user used to initialize the user Id.
Tries to read element from XML.
The reader.
Implementation
// static implicit operator UserId(String primarySmtpAddress)
// {
// return new UserId(primarySmtpAddress);
// }
/// <summary>
/// Implements an implicit conversion between StandardUser and UserId.
/// </summary>
/// <param name="standardUser">The standard user used to initialize the user Id.</param>
/// <returns>A UserId initialized with the specified standard user value.</returns>
// static implicit operator UserId(StandardUser standardUser)
// {
// return new UserId(standardUser);
// }
/// <summary>
/// Tries to read element from XML.
/// </summary>
/// <param name="reader">The reader.</param>
/// <returns>True if element was read.</returns>
@override
Future<bool> TryReadElementFromXml(EwsServiceXmlReader reader) async {
switch (reader.LocalName) {
case XmlElementNames.SID:
this._sID = await reader.ReadValue();
return true;
case XmlElementNames.PrimarySmtpAddress:
this._primarySmtpAddress = await reader.ReadValue();
return true;
case XmlElementNames.DisplayName:
this._displayName = await reader.ReadValue();
return true;
case XmlElementNames.DistinguishedUser:
this._standardUser =
await reader.ReadValue<enumerations.StandardUser>();
return true;
default:
return false;
}
}