public string NeedAttr(object element, string attributeName) { XmlNode xmlNode = InMetaXmlUtils.TryGetXmlNode(element); if (xmlNode != null) { return(((XmlElement)xmlNode).GetAttribute(attributeName)); } return(InMetaXmlUtils.InteropGetAttribute(element, attributeName) ?? throw new Exception("Элемент не содержит обязательный атрибут \"" + attributeName + "\".")); }
public string GetAttr(object element, string attributeName, string attributeDefaultValue = "") { XmlNode xmlNode = InMetaXmlUtils.TryGetXmlNode(element); return(xmlNode != null?XmlUtils.GetAttr(xmlNode, attributeName, attributeDefaultValue) : InMetaXmlUtils.InteropGetAttribute(element, attributeName) ?? attributeDefaultValue); }
public bool HasAttr(object element, string attributeName) { XmlNode xmlNode = InMetaXmlUtils.TryGetXmlNode(element); return(xmlNode != null ? ((XmlElement)xmlNode).HasAttribute(attributeName) : InMetaXmlUtils.InteropGetAttribute(element, attributeName) != null); }