Exemple #1
0
        private XsdNs.ProductionScheduleType[] CreateScheduleProxies(out ICollection <Type> extraTypes)
        {
            var retval        = new XsdNs.ProductionScheduleType[ProductionSchedules.Count];
            var extraTypesSet = new HashSet <Type>();

            for (int a = 0; a < ProductionSchedules.Count; ++a)
            {
                retval[a] = ProductionSchedules[a].ToXmlProxy(out ICollection <Type> extraTypesTemp);

                // Adding any required extra types
                extraTypesSet.UnionWith(extraTypesTemp);
            }

            extraTypes = extraTypesSet;
            return(retval);
        }
Exemple #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="proxy">XML proxy.</param>
        /// <exception cref="XNeut.InvalidMessageException">Thrown if an error is encountered.</exception>
        internal ProductionSchedule(XsdNs.ProductionScheduleType proxy)
        {
            ProductionRequests = new List <ProductionRequest>();

            // Reading items from proxy
            try
            {
                if (proxy.ProductionRequest != null)
                {
                    foreach (var requestProxy in proxy.ProductionRequest)
                    {
                        ProductionRequests.Add(new ProductionRequest(requestProxy));
                    }
                }
            }
            catch (NullReferenceException e)
            {
                throw new XNeut.InvalidMessageException("Failed to read ProductionSchedule - something required is missing", e);
            }
        }