示例#1
0
        /// <summary>Find or create a qualifier node under a given parent node.</summary>
        /// <remarks>
        /// Find or create a qualifier node under a given parent node. Returns a pointer to the
        /// qualifier node, and optionally an iterator for the node's position in
        /// the parent's vector of qualifiers. The iterator is unchanged if no qualifier node (null)
        /// is returned.
        /// <em>Note:</em> On entry, the qualName parameter must not have the leading '?' from the
        /// XMPPath step.
        /// </remarks>
        /// <param name="parent">the parent XMPNode</param>
        /// <param name="qualName">the qualifier name</param>
        /// <param name="createNodes">flag if nodes shall be created</param>
        /// <returns>Returns the qualifier node if found or created, <code>null</code> otherwise.</returns>
        /// <exception cref="Com.Adobe.Xmp.XMPException"></exception>
        private static XMPNode FindQualifierNode(XMPNode parent, string qualName, bool createNodes)
        {
            System.Diagnostics.Debug.Assert(!qualName.StartsWith("?"));
            XMPNode qualNode = parent.FindQualifierByName(qualName);

            if (qualNode == null && createNodes)
            {
                qualNode = new XMPNode(qualName, null);
                qualNode.SetImplicit(true);
                parent.AddQualifier(qualNode);
            }
            return(qualNode);
        }
 /// <summary>Find or create a qualifier node under a given parent node.</summary>
 /// <remarks>
 /// Find or create a qualifier node under a given parent node. Returns a pointer to the
 /// qualifier node, and optionally an iterator for the node's position in
 /// the parent's vector of qualifiers. The iterator is unchanged if no qualifier node (null)
 /// is returned.
 /// <em>Note:</em> On entry, the qualName parameter must not have the leading '?' from the
 /// XMPPath step.
 /// </remarks>
 /// <param name="parent">the parent XMPNode</param>
 /// <param name="qualName">the qualifier name</param>
 /// <param name="createNodes">flag if nodes shall be created</param>
 /// <returns>Returns the qualifier node if found or created, <code>null</code> otherwise.</returns>
 /// <exception cref="Com.Adobe.Xmp.XMPException"></exception>
 private static XMPNode FindQualifierNode(XMPNode parent, string qualName, bool createNodes)
 {
     System.Diagnostics.Debug.Assert(!qualName.StartsWith("?"));
     XMPNode qualNode = parent.FindQualifierByName(qualName);
     if (qualNode == null && createNodes)
     {
         qualNode = new XMPNode(qualName, null);
         qualNode.SetImplicit(true);
         parent.AddQualifier(qualNode);
     }
     return qualNode;
 }