Esempio n. 1
0
        public DescribeStackResourcesResult Unmarshall(UnmarshallerContext context)
        {
            DescribeStackResourcesResult describeStackResourcesResult = new DescribeStackResourcesResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("StackResources/member", targetDepth))
                    {
                        describeStackResourcesResult.StackResources.Add(StackResourceUnmarshaller.GetInstance().Unmarshall(context));

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

            return(describeStackResourcesResult);
        }
        public static StackResourceUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new StackResourceUnmarshaller();
            }

            return(instance);
        }