コード例 #1
0
        ///
        ///	 <summary> * fitsValueElem - checks whether <code>pdfPath</code> matches the
        ///	 * subelement <code>Value</code> specified for this State
        ///	 *  </summary>
        ///	 * <param name="pdfPath">
        ///	 *            PDFPath to test </param>
        ///	 * <param name="valueusage">
        ///	 *            switches between Allowed and Present configuration in
        ///	 *            subelement <code>Value</code>.
        ///	 *  </param>
        ///	 * <returns> boolean - true, if <code>pdfPath</code> matches subelement
        ///	 *         <code>Value</code> </returns>
        ///
        private bool fitsValueElem(string pdfPath, EnumFitsValue valuelist)
        {
            VElement v        = getChildElementVector(ElementName.VALUE, null, null, true, 0, false);
            int      siz      = v.Count;
            bool     hasValue = false;

            for (int i = 0; i < siz; i++)
            {
                JDFValue elm = (JDFValue)v[i];
                if (elm.hasAttribute(AttributeName.VALUEUSAGE))
                {
                    EnumFitsValue valueUsage = getValueValueUsage(i);
                    if (valuelist.Equals(valueUsage))
                    {
                        hasValue = true;
                        string @value = getValueAllowedValue(i);
                        if (@value.CompareTo(pdfPath) == 0)
                        {
                            return(true); // we have found it
                        }
                    }
                }
                else
                {
                    hasValue = true;
                    string @value = getValueAllowedValue(i);
                    if (@value.CompareTo(pdfPath) == 0)
                    {
                        return(true); // we have found it
                    }
                }
            }
            return(!hasValue);
        }
コード例 #2
0
        ///
        ///	 <summary> * fitsValueElem - tests, if JDFMatrix <code>matrix</code> matches
        ///	 * subelement Value, specified for this State
        ///	 *  </summary>
        ///	 * <param name="matrix">
        ///	 *            JDFMatrix to test </param>
        ///	 * <param name="valuelist">
        ///	 *            switches between Allowed and Present configuration in
        ///	 *            subelement Value.
        ///	 *  </param>
        ///	 * <returns> boolean - true, if <code>matrix</code> matches subelement Value </returns>
        ///
        private bool fitsValueElem(JDFMatrix matrix, EnumFitsValue valuelist)
        {
            VElement v        = getChildElementVector(ElementName.VALUE, null, null, true, 0, false);
            int      siz      = v.Count;
            bool     hasValue = false;

            for (int i = 0; i < siz; i++)
            {
                JDFValue elm = (JDFValue)v[i];
                if (elm.hasAttribute(AttributeName.VALUEUSAGE))
                {
                    EnumFitsValue valueUsage = getValueValueUsage(i);
                    if (valuelist.Equals(valueUsage))
                    {
                        hasValue = true;
                        JDFMatrix @value = getValueAllowedValue(i);
                        if (@value.Equals(matrix))
                        {
                            return(true); // we have found it
                        }
                    }
                }
                else
                {
                    hasValue = true;
                    JDFMatrix @value = getValueAllowedValue(i);
                    if (@value.Equals(matrix))
                    {
                        return(true); // we have found it
                    }
                }
            }
            return(!hasValue); // if no matching, there was no filter
        }