Пример #1
0
        ///
        ///	 <summary> * } getAudits - get all audits with attributes and partMap
        ///	 *  </summary>
        ///	 * <param name="typ"> type of the audit to take </param>
        ///	 * <param name="mAttributes"> attribute map to filter the audits </param>
        ///	 * <param name="vParts"> the partmap vector - note that not all audits legally have parts </param>
        ///	 * <returns> VElement - all elements, that matches the filter
        ///	 *
        ///	 *         default: getAudits(null, null, null) </returns>
        ///
        public virtual VElement getAudits(JDFAudit.EnumAuditType typ, JDFAttributeMap mAttributes, VJDFAttributeMap vParts)
        {
            VJDFAttributeMap vPartsLocal  = vParts;
            string           strAuditType = null;

            if (typ != null)
            {
                strAuditType = typ.getName();
            }

            VElement vElem = getPoolChildrenGeneric(strAuditType, mAttributes, null);

            if (vPartsLocal != null && vPartsLocal.Count == 0)
            {
                vPartsLocal = null;
            }

            for (int i = vElem.Count - 1; i >= 0; i--)
            { // remove known comments - this would be aught in the next check but
                // we avoid the exception
                if (!(vElem[i] is JDFAudit))
                {
                    vElem.RemoveAt(i);
                    continue; // look at next element
                }

                JDFAudit audit = (JDFAudit)vElem[i];
                if (vPartsLocal != null && !vPartsLocal.Equals(audit.getPartMapVector()))
                {
                    vElem.RemoveAt(i);
                    continue; // look at next element
                }
            }
            return(vElem);
        }
Пример #2
0
        ///
        ///	 <summary> * get the index'th audit of the given typ
        ///	 *  </summary>
        ///	 * <param name="index"> index of the audit negativ values are possible and will be substracted from the vector size. For
        ///	 *            example,your given Filter returns a Vector of 10 Posible Elements and your index is -7 you will get 10
        ///	 *            - 7 = Element Number 3 </param>
        ///	 * <param name="typ"> type of the audit to take </param>
        ///	 * <param name="mAttributes"> attribute map to filter the audits </param>
        ///	 * <param name="vParts"> the partmap vector - note that not all audits legally have parts </param>
        ///	 * <returns> an Audit that matches the filers
        ///	 *
        ///	 *         default: getAudit(index, typ, null) </returns>
        ///
        public virtual JDFAudit getAudit(int index, JDFAudit.EnumAuditType typ, JDFAttributeMap mAttributes, VJDFAttributeMap vParts)
        {
            int indexLocal = index;

            VElement v = getAudits(typ, mAttributes, vParts);

            if (indexLocal < 0)
            {
                indexLocal = v.Count + indexLocal;
            }
            if (indexLocal >= v.Count || indexLocal < 0)
            {
                return(null);
            }

            return((JDFAudit)v[indexLocal]);
        }
Пример #3
0
        ///
        ///	 <summary> * add an audit, called internally by the specialized functions
        ///	 *  </summary>
        ///	 * <param name="typ"> audit type </param>
        ///	 * <param name="by"> the author keyword </param>
        ///	 * <returns> JDFAudit
        ///	 *
        ///	 *         default: AddAudit(typ, JDFConstants.EMPTYSTRING) </returns>
        ///
        public virtual JDFAudit addAudit(JDFAudit.EnumAuditType typ, string by)
        {
            JDFAudit l = (JDFAudit)appendElement(typ.getName(), null);

            if (by != null)
            {
                l.setAuthor(by);
            }

            JDFNode r = getJDFRoot();

            if (r.hasAttribute(AttributeName.SPAWNID))
            {
                l.setSpawnID(r.getSpawnID(false));
            }

            return(l);
        }
Пример #4
0
 public virtual JDFAudit getAudit(int index, JDFAudit.EnumAuditType typ, JDFAttributeMap mAttributes)
 {
     return(getAudit(index, typ, mAttributes, null));
 }
Пример #5
0
 public virtual VElement getAudits(JDFAudit.EnumAuditType typ, JDFAttributeMap mAttributes)
 {
     return(getAudits(typ, mAttributes, null));
 }