Пример #1
0
            ///
            ///		 <summary> * sets the attribute occurence in the appropriate PartAmount when called for a resourceLink and creates the
            ///		 * AmountPool and/or PartAmount(s) if they are not yet there
            ///		 *  </summary>
            ///		 * <param name="attrib"> the attribute name </param>
            ///		 * <param name="value"> value to set in string form. </param>
            ///		 * <param name="nameSpaceURI"> the XML-namespace </param>
            ///		 * <param name="vPart"> defines which part of this ResourceLink the Amount belongs to, if empty set the ResourceLink
            ///		 *            root attribute. </param>
            ///		 * <exception cref="JDFException"> when called directly on a PartAmount
            ///		 * @since 060630 </exception>
            ///
            public static void setAmountPoolAttribute(IAmountPoolContainer poolParent, string attrib, string @value, string nameSpaceURI, VJDFAttributeMap vPart)
            {
                // ideally the method would be hidden in PartAmount
                if ((vPart == null) || (vPart.IsEmpty()) || vPart.Count == 1 && vPart[0].Count == 0)
                {
                    poolParent.setAttribute(attrib, @value, nameSpaceURI);
                    return;
                }
                poolParent.removeAttribute(attrib, nameSpaceURI); // either in the
                // pool or the
                // link, not both
                JDFAmountPool ap  = poolParent.getCreateAmountPool();
                JDFPartAmount pa0 = ap.getCreatePartAmount(vPart);

                pa0.setAttribute(attrib, @value, nameSpaceURI);
            }