Beispiel #1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, CreateCacheSecurityGroupResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("CacheSecurityGroup", targetDepth))
                    {
                        response.CacheSecurityGroup = CacheSecurityGroupUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }
        }
        public CreateCacheSecurityGroupResult Unmarshall(XmlUnmarshallerContext context)
        {
            CreateCacheSecurityGroupResult result = new CreateCacheSecurityGroupResult();

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("CacheSecurityGroup", targetDepth))
                    {
                        result.CacheSecurityGroup = CacheSecurityGroupUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(result);
                }
            }



            return(result);
        }
        public static CacheSecurityGroupUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new CacheSecurityGroupUnmarshaller();
            }

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

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

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

                        continue;
                    }
                    if (context.TestExpression("CacheSecurityGroups/CacheSecurityGroup", targetDepth))
                    {
                        describeCacheSecurityGroupsResult.CacheSecurityGroups.Add(CacheSecurityGroupUnmarshaller.GetInstance().Unmarshall(context));

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



            return(describeCacheSecurityGroupsResult);
        }