Exemplo n.º 1
0
 /// <summary>The outermost call is special.</summary>
 /// <remarks>
 /// The outermost call is special. The names almost certainly differ. The
 /// qualifiers (and hence options) will differ for an alias to the x-default
 /// item of a langAlt array.
 /// </remarks>
 /// <param name="aliasNode">the alias node</param>
 /// <param name="baseNode">the base node of the alias</param>
 /// <param name="outerCall">marks the outer call of the recursion</param>
 /// <exception cref="XmpException">Forwards XMP errors</exception>
 private static void CompareAliasedSubtrees(XmpNode aliasNode, XmpNode baseNode, bool outerCall)
 {
     if (!aliasNode.Value.Equals(baseNode.Value) || aliasNode.GetChildrenLength() != baseNode.GetChildrenLength())
     {
         throw new XmpException("Mismatch between alias and base nodes", XmpErrorCode.BadXmp);
     }
     if (!outerCall && (!aliasNode.Name.Equals(baseNode.Name) || !aliasNode.Options.Equals(baseNode.Options) || aliasNode.GetQualifierLength() != baseNode.GetQualifierLength()))
     {
         throw new XmpException("Mismatch between alias and base nodes", XmpErrorCode.BadXmp);
     }
     for (IIterator an = aliasNode.IterateChildren(), bn = baseNode.IterateChildren(); an.HasNext() && bn.HasNext();)
     {
         var aliasChild = (XmpNode)an.Next();
         var baseChild  = (XmpNode)bn.Next();
         CompareAliasedSubtrees(aliasChild, baseChild, false);
     }
     for (IIterator an1 = aliasNode.IterateQualifier(), bn1 = baseNode.IterateQualifier(); an1.HasNext() && bn1.HasNext();)
     {
         var aliasQual = (XmpNode)an1.Next();
         var baseQual  = (XmpNode)bn1.Next();
         CompareAliasedSubtrees(aliasQual, baseQual, false);
     }
 }