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

            return(instance);
        }
Beispiel #2
0
        public Subnet Unmarshall(XmlUnmarshallerContext context)
        {
            Subnet subnet        = new Subnet();
            int    originalDepth = context.CurrentDepth;
            int    targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("SubnetAvailabilityZone", targetDepth))
                    {
                        subnet.SubnetAvailabilityZone = AvailabilityZoneUnmarshaller.GetInstance().Unmarshall(context);

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



            return(subnet);
        }