public static HostedZoneConfigUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new HostedZoneConfigUnmarshaller();
            }

            return(instance);
        }
Exemplo n.º 2
0
        public HostedZone Unmarshall(XmlUnmarshallerContext context)
        {
            HostedZone hostedZone    = new HostedZone();
            int        originalDepth = context.CurrentDepth;
            int        targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("Name", targetDepth))
                    {
                        hostedZone.Name = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("CallerReference", targetDepth))
                    {
                        hostedZone.CallerReference = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Config", targetDepth))
                    {
                        hostedZone.Config = HostedZoneConfigUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ResourceRecordSetCount", targetDepth))
                    {
                        hostedZone.ResourceRecordSetCount = LongUnmarshaller.GetInstance().Unmarshall(context);

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



            return(hostedZone);
        }