예제 #1
0
        public CreateCacheParameterGroupResult Unmarshall(XmlUnmarshallerContext context)
        {
            CreateCacheParameterGroupResult result = new CreateCacheParameterGroupResult();

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

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

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



            return(result);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, CreateCacheParameterGroupResponse 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("CacheParameterGroup", targetDepth))
                    {
                        response.CacheParameterGroup = CacheParameterGroupUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }
        }
        public static CacheParameterGroupUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new CacheParameterGroupUnmarshaller();
            }

            return(instance);
        }
        public DescribeCacheParameterGroupsResult Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeCacheParameterGroupsResult describeCacheParameterGroupsResult = new DescribeCacheParameterGroupsResult();
            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))
                    {
                        describeCacheParameterGroupsResult.Marker = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("CacheParameterGroups/CacheParameterGroup", targetDepth))
                    {
                        describeCacheParameterGroupsResult.CacheParameterGroups.Add(CacheParameterGroupUnmarshaller.GetInstance().Unmarshall(context));

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



            return(describeCacheParameterGroupsResult);
        }