TryReadElementFromXmlToPatch method
For ItemAttachment, AttachmentId and Item should be patched.
Implementation
@override
Future<bool> TryReadElementFromXmlToPatch(EwsServiceXmlReader reader) async {
// update the attachment id.
await super.TryReadElementFromXml(reader);
await reader.Read();
Type? itemClass = EwsUtilities.GetItemTypeFromXmlElementName(
reader.LocalName,
);
if (itemClass != null) {
if (_item == null || _item.runtimeType != itemClass) {
throw ServiceLocalException("Strings.AttachmentItemTypeMismatch");
}
await _item!.LoadFromXml(reader, false /* clearPropertyBag */);
return true;
}
return false;
}