예제 #1
0
        private XsdNs.MaterialRequirementType[] BuildAssemblyReqsForProxy()
        {
            var retval = new XsdNs.MaterialRequirementType[AssemblyRequirements.Count];

            for (int a = 0; a < AssemblyRequirements.Count; ++a)
            {
                retval[a] = AssemblyRequirements[a].ToXmlProxy();
            }

            return(retval);
        }
예제 #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="proxy">XML proxy.</param>
        /// <exception cref="XNeut.InvalidMessageException">Thrown if an error is encountered.</exception>
        internal MaterialRequirement(XsdNs.MaterialRequirementType proxy)
            : this() // Call the default constructor
        {
            if (proxy.MaterialDefinitionID != null)
            {
                foreach (var idProxy in proxy.MaterialDefinitionID)
                {
                    MaterialDefinitionIdentifiers.Add(new IdentifierType(idProxy)); // throws InvalidMessageException
                }
            }

            if (proxy.MaterialLotID != null)
            {
                foreach (var idProxy in proxy.MaterialLotID)
                {
                    MaterialLotIdentifiers.Add(new IdentifierType(idProxy)); // throws InvalidMessageException
                }
            }

            if (proxy.MaterialUse != null)
            {
                MaterialUse = new MaterialUse(proxy.MaterialUse); // throws InvalidMessageException
            }

            if (proxy.Quantity != null)
            {
                foreach (var qItem in proxy.Quantity)
                {
                    Quantities.Add(new QuantityValue(qItem)); // throws InvalidMessageException
                }
            }

            if (proxy.AssemblyRequirement != null)
            {
                foreach (var arItem in proxy.AssemblyRequirement)
                {
                    AssemblyRequirements.Add(new MaterialRequirement(arItem)); // throws InvalidMessageException
                }
            }
        }