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

            return(instance);
        }
Esempio n. 2
0
        public InternetGateway Unmarshall(XmlUnmarshallerContext context)
        {
            InternetGateway internetGateway = new InternetGateway();
            int             originalDepth   = context.CurrentDepth;
            int             targetDepth     = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("attachmentSet/item", targetDepth))
                    {
                        internetGateway.Attachments.Add(InternetGatewayAttachmentUnmarshaller.GetInstance().Unmarshall(context));

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

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



            return(internetGateway);
        }