CreateItemFromXmlElementName static method

Item? CreateItemFromXmlElementName(
  1. ItemAttachment itemAttachment,
  2. String xmlElementName
)
Creates Item based on XML element name. The item attachment. Name of the XML element.

Implementation

static Item? CreateItemFromXmlElementName(
    ItemAttachment itemAttachment, String xmlElementName) {
  if (EwsUtilities
      .serviceObjectInfo.Member!.XmlElementNameToServiceObjectClassMap
      .containsKey(xmlElementName)) {
    Type? itemClass = EwsUtilities.serviceObjectInfo.Member!
        .XmlElementNameToServiceObjectClassMap[xmlElementName];
    return CreateItemFromItemClass(itemAttachment, itemClass, false);
  } else {
    return null;
  }
}