コード例 #1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketMetricsConfigurationResponse response)
        {
            int currentDepth = context.get_CurrentDepth();
            int num          = currentDepth + 1;

            if (context.get_IsStartOfDocument())
            {
                num += 2;
            }
            response.MetricsConfiguration = new MetricsConfiguration();
            while (context.Read())
            {
                if (context.get_IsStartElement() || context.get_IsAttribute())
                {
                    if (context.TestExpression("Filter", num))
                    {
                        response.MetricsConfiguration.MetricsFilter = new MetricsFilter
                        {
                            MetricsFilterPredicate = MetricsPredicateListFilterUnmarshaller.Instance.Unmarshall(context)[0]
                        };
                    }
                    else if (context.TestExpression("Id", num))
                    {
                        response.MetricsConfiguration.MetricsId = StringUnmarshaller.get_Instance().Unmarshall(context);
                    }
                }
                else if (context.get_IsEndElement() && context.get_CurrentDepth() < currentDepth)
                {
                    break;
                }
            }
        }
コード例 #2
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            GetBucketMetricsConfigurationResponse getBucketMetricsConfigurationResponse = new GetBucketMetricsConfigurationResponse();

            while (context.Read())
            {
                if (context.get_IsStartElement())
                {
                    UnmarshallResult(context, getBucketMetricsConfigurationResponse);
                }
            }
            return(getBucketMetricsConfigurationResponse);
        }
コード例 #3
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketMetricsConfigurationResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            response.MetricsConfiguration = new MetricsConfiguration();

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Filter", targetDepth))
                    {
                        response.MetricsConfiguration.MetricsFilter = new MetricsFilter()
                        {
                            MetricsFilterPredicate = (MetricsPredicateListFilterUnmarshaller.Instance.Unmarshall(context))[0]
                        };
                        continue;
                    }
                    if (context.TestExpression("Id", targetDepth))
                    {
                        response.MetricsConfiguration.MetricsId = StringUnmarshaller.Instance.Unmarshall(context);

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



            return;
        }