private bool VerifyDictionaryPairElements(ref Type keyType, ref bool isKeyAttrib, ref bool isKeyContent, XName keyAlias, XElement childElem)
{
bool isKeyFound = false;
if (isKeyAttrib && childElem.Attribute_NamespaceSafe(keyAlias, m_documentDefaultNamespace) != null)
{
isKeyFound = true;
}
else if (isKeyContent && childElem.GetXmlContent() != null)
{
isKeyFound = true;
}
else if (isKeyAttrib || isKeyContent)
{
// loook for an element with the same name AND a yaxlib:realtype attribute
XElement elem = childElem.Element(keyAlias);
if (elem != null)
{
XAttribute realTypeAttr = elem.Attribute_NamespaceSafe(m_yaxLibNamespaceUri + m_trueTypeAttrName, m_documentDefaultNamespace);
if (realTypeAttr != null)
{
Type theRealType = ReflectionUtils.GetTypeByName(realTypeAttr.Value);
if (theRealType != null)
{
keyType = theRealType;
isKeyAttrib = false;
isKeyContent = false;
isKeyFound = true;
}
}
}
}
else
{
XElement elem = childElem.Element(keyAlias);
if (elem != null)
{
isKeyFound = true;
XAttribute realTypeAttr = elem.Attribute_NamespaceSafe(m_yaxLibNamespaceUri + m_trueTypeAttrName, m_documentDefaultNamespace);
if (realTypeAttr != null)
{
Type theRealType = ReflectionUtils.GetTypeByName(realTypeAttr.Value);
if (theRealType != null)
{
keyType = theRealType;
}
}
}
}
return isKeyFound;
}