コード例 #1
0
        public static NetworkAclAssociationUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new NetworkAclAssociationUnmarshaller();
            }

            return(instance);
        }
コード例 #2
0
        public NetworkAcl Unmarshall(XmlUnmarshallerContext context)
        {
            NetworkAcl networkAcl    = new NetworkAcl();
            int        originalDepth = context.CurrentDepth;
            int        targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("vpcId", targetDepth))
                    {
                        networkAcl.VpcId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("default", targetDepth))
                    {
                        networkAcl.IsDefault = BoolUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("entrySet/item", targetDepth))
                    {
                        networkAcl.Entries.Add(NetworkAclEntryUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("associationSet/item", targetDepth))
                    {
                        networkAcl.Associations.Add(NetworkAclAssociationUnmarshaller.GetInstance().Unmarshall(context));

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

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



            return(networkAcl);
        }