public static XmlName GetXmlName(this IXmlObject xmlObject) { Type xmlObjectType; XmlName xmlName; XmlElementMappingAttribute xmlElementMappingAttribute; if ((object)xmlObject == null) throw new ArgumentNullException(nameof(xmlObject)); xmlObjectType = xmlObject.GetType(); xmlElementMappingAttribute = SolderLegacyInstanceAccessor.ReflectionFascadeLegacyInstance.GetOneAttribute<XmlElementMappingAttribute>(xmlObjectType); if ((object)xmlElementMappingAttribute == null) xmlName = null; else { xmlName = new XmlName() { LocalName = xmlElementMappingAttribute.LocalName, NamespaceUri = xmlElementMappingAttribute.NamespaceUri }; } return xmlName; }
public void AddReference(XmlName xmlName, Type xmlObjectType) { if ((object)xmlName == null) throw new ArgumentNullException(nameof(xmlName)); if ((object)xmlObjectType == null) throw new ArgumentNullException(nameof(xmlObjectType)); this.Xpe.RegisterKnownXmlObject(xmlName, xmlObjectType); }
/// <summary> /// Performs a custom equals test against two XML name objects using value semantics over the local name and namespace URI. /// </summary> /// <param name="a"> The first XML name to test. </param> /// <param name="b"> The second XML name object to test. </param> /// <returns> A value indicating whther the two XML name objects are equal using value semantics. </returns> private static bool TestEquals(XmlName a, XmlName b) { return (a.LocalName == b.LocalName) && (a.NamespaceUri == b.NamespaceUri); }
/// <summary> /// Performs a custom equals test against two XML name objects using value semantics over the local name and namespace URI. /// </summary> /// <param name="a"> The first XML name to test. </param> /// <param name="b"> The second XML name object to test. </param> /// <returns> A value indicating whther the two XML name objects are equal using value semantics. </returns> private static bool TestEquals(XmlName a, XmlName b) { return((a.LocalName == b.LocalName) && (a.NamespaceUri == b.NamespaceUri)); }