コード例 #1
0
        ///
        ///	 <summary> * Get the linked resources matching some conditions
        ///	 *  </summary>
        ///	 * <param name="mResAtt"> map of Resource attributes to search for </param>
        ///	 * <param name="bFollowRefs"> true if internal references shall be followed </param>
        ///	 * <returns> vector with all elements matching the conditions default: GetLinkedResources(new JDFAttributeMap(),
        ///	 *         false) </returns>
        ///
        public virtual VElement getLinkedResources(JDFAttributeMap mResAtt, bool bFollowRefs)
        {
            VElement vChild = getChildElementVector(null, null, null, true, 99999, false);
            VElement vElem  = new VElement();

            for (int i = 0; i < vChild.Count; i++)
            {
                JDFResource r    = null;
                object      elem = vChild[i];
                if ((elem is JDFRefElement))
                {
                    JDFRefElement l = (JDFRefElement)elem;
                    r = l.getLinkRoot(null);
                }
                else if (elem is JDFResource)
                {
                    r = (JDFResource)elem;
                }
                if (r != null && r.includesAttributes(mResAtt, true))
                {
                    vElem.Add(r); // vElem.push_back(r);
                    if (bFollowRefs)
                    {
                        vElem.appendUnique(r.getvHRefRes(bFollowRefs, true));
                    }
                }
            }

            return(vElem);
        }
コード例 #2
0
        ///
        ///	 <summary> * Get the linked resources matching some conditions
        ///	 *  </summary>
        ///	 * <param name="mResAtt"> map of Resource attributes to search for </param>
        ///	 * <param name="bFollowRefs"> true if internal references shall be followed
        ///	 *  </param>
        ///	 * <returns> vResource: vector with all elements matching the conditions
        ///	 *
        ///	 *         default: GetLinkedResources(new JDFAttributeMap(), false) </returns>
        ///
        public virtual VElement getLinkedResources(JDFAttributeMap mResAtt, bool bFollowRefs)
        {
            VElement vChild = getPoolChildren(mResAtt);
            VElement vElem  = new VElement();

            for (int i = 0; i < vChild.Count; i++)
            {
                JDFAncestor anc = (JDFAncestor)vChild[i];
                vElem.appendUnique(anc.getLinkedResources(mResAtt, bFollowRefs));
            }
            return(vElem);
        }
コード例 #3
0
ファイル: JDFAuditPool.cs プロジェクト: cip4/JDFLibNet
        ///
        ///	 <summary> * get the linked resources matching some conditions
        ///	 *  </summary>
        ///	 * <param name="mResAtt"> map of Resource attributes to search for </param>
        ///	 * <param name="bFollowRefs"> true if internal references shall be followed </param>
        ///	 * <returns> VElement vector with all elements matching the conditions
        ///	 *
        ///	 *         default: getLinkedResources(null, true) </returns>
        ///
        public virtual VElement getLinkedResources(JDFAttributeMap mResAtt, bool bFollowRefs)
        {
            VString refs = getHRefs(null, false, true);

            refs.unify();
            VElement v = new VElement();

            for (int i = 0; i < refs.Count; i++)
            {
                KElement e = getTarget(refs[i], AttributeName.ID);
                if (e != null && e.includesAttributes(mResAtt, true))
                {
                    v.Add(e);
                    if (bFollowRefs && (e is JDFElement))
                    {
                        v.appendUnique(((JDFElement)e).getvHRefRes(bFollowRefs, true));
                    }
                }
            }
            return(v);
        }
コード例 #4
0
        ///
        ///	 <summary> * getDevCapVector()
        ///	 *  </summary>
        ///	 * <returns> VElement </returns>
        ///
        public VElement getDevCapVector()
        {
            VElement vDevCap = getChildElementVector(ElementName.DEVCAP, null, null, true, 0, false);
            string   dcr     = getAttribute(AttributeName.DEVCAPREF, null, null);

            if (dcr != null)
            {
                JDFDevCapPool dcp = getDevCapPool();
                if (dcp != null)
                {
                    VString v = new VString(StringUtil.tokenize(dcr, " ", false));
                    for (int i = 0; i < v.Count; i++)
                    {
                        string   s    = v.stringAt(i);
                        KElement dcre = dcp.getChildWithAttribute(ElementName.DEVCAP, AttributeName.ID, null, s, 0, true);
                        vDevCap.appendUnique(dcre);
                    }
                }
            }
            return(vDevCap);
        }