Esempio n. 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);
        }