Beispiel #1
0
        public static InstanceCountUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new InstanceCountUnmarshaller();
            }

            return(instance);
        }
        public ReservedInstancesListing Unmarshall(XmlUnmarshallerContext context)
        {
            ReservedInstancesListing reservedInstancesListing = new ReservedInstancesListing();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 1;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("reservedInstancesListingId", targetDepth))
                    {
                        reservedInstancesListing.ReservedInstancesListingId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("reservedInstancesId", targetDepth))
                    {
                        reservedInstancesListing.ReservedInstancesId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("createDate", targetDepth))
                    {
                        reservedInstancesListing.CreateDate = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("updateDate", targetDepth))
                    {
                        reservedInstancesListing.UpdateDate = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("status", targetDepth))
                    {
                        reservedInstancesListing.Status = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("statusMessage", targetDepth))
                    {
                        reservedInstancesListing.StatusMessage = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("instanceCounts/item", targetDepth))
                    {
                        reservedInstancesListing.InstanceCounts.Add(InstanceCountUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("priceSchedules/item", targetDepth))
                    {
                        reservedInstancesListing.PriceSchedules.Add(PriceScheduleUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("tagSet/item", targetDepth))
                    {
                        reservedInstancesListing.Tags.Add(TagUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("clientToken", targetDepth))
                    {
                        reservedInstancesListing.ClientToken = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(reservedInstancesListing);
                }
            }



            return(reservedInstancesListing);
        }