/// <summary> /// Tries to read the element at the current position of the reader. /// </summary> /// <param name="reader">The reader to read the element from.</param> /// <returns>True if the element was read, false otherwise.</returns> internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) { bool result = base.TryReadElementFromXml(reader); if (!result) { this.item = EwsUtilities.CreateItemFromXmlElementName(this, reader.LocalName); if (this.item != null) { this.item.LoadFromXml(reader, true /* clearPropertyBag */); } } return(result); }
/// <summary> /// Loads from json. /// </summary> /// <param name="jsonProperty">The json property.</param> /// <param name="service"></param> internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) { base.LoadFromJson(jsonProperty, service); if (jsonProperty.ContainsKey(XmlElementNames.Item)) { JsonObject jsonItem = jsonProperty.ReadAsJsonObject(XmlElementNames.Item); // skip this - "Item" : null if (jsonItem != null) { this.item = EwsUtilities.CreateItemFromXmlElementName(this, jsonItem.ReadTypeString()); if (this.item != null) { this.item.LoadFromJson(jsonItem, service, true /* clearPropertyBag */); } } } }