コード例 #1
0
        public DefaultCacheBehavior Unmarshall(XmlUnmarshallerContext context)
        {
            DefaultCacheBehavior defaultCacheBehavior = new DefaultCacheBehavior();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("ForwardedValues", targetDepth))
                    {
                        defaultCacheBehavior.ForwardedValues = ForwardedValuesUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("TrustedSigners", targetDepth))
                    {
                        defaultCacheBehavior.TrustedSigners = TrustedSignersUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ViewerProtocolPolicy", targetDepth))
                    {
                        defaultCacheBehavior.ViewerProtocolPolicy = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("MinTTL", targetDepth))
                    {
                        defaultCacheBehavior.MinTTL = LongUnmarshaller.GetInstance().Unmarshall(context);

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



            return(defaultCacheBehavior);
        }
        public StreamingDistributionConfig Unmarshall(XmlUnmarshallerContext context)
        {
            StreamingDistributionConfig streamingDistributionConfig = new StreamingDistributionConfig();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("S3Origin", targetDepth))
                    {
                        streamingDistributionConfig.S3Origin = S3OriginUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Aliases", targetDepth))
                    {
                        streamingDistributionConfig.Aliases = AliasesUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Comment", targetDepth))
                    {
                        streamingDistributionConfig.Comment = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Logging", targetDepth))
                    {
                        streamingDistributionConfig.Logging = StreamingLoggingConfigUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("TrustedSigners", targetDepth))
                    {
                        streamingDistributionConfig.TrustedSigners = TrustedSignersUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("PriceClass", targetDepth))
                    {
                        streamingDistributionConfig.PriceClass = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Enabled", targetDepth))
                    {
                        streamingDistributionConfig.Enabled = BoolUnmarshaller.GetInstance().Unmarshall(context);

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



            return(streamingDistributionConfig);
        }
        public StreamingDistributionSummary Unmarshall(XmlUnmarshallerContext context)
        {
            StreamingDistributionSummary streamingDistributionSummary = new StreamingDistributionSummary();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("Status", targetDepth))
                    {
                        streamingDistributionSummary.Status = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("LastModifiedTime", targetDepth))
                    {
                        streamingDistributionSummary.LastModifiedTime = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("DomainName", targetDepth))
                    {
                        streamingDistributionSummary.DomainName = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("S3Origin", targetDepth))
                    {
                        streamingDistributionSummary.S3Origin = S3OriginUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Aliases", targetDepth))
                    {
                        streamingDistributionSummary.Aliases = AliasesUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("TrustedSigners", targetDepth))
                    {
                        streamingDistributionSummary.TrustedSigners = TrustedSignersUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Comment", targetDepth))
                    {
                        streamingDistributionSummary.Comment = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("PriceClass", targetDepth))
                    {
                        streamingDistributionSummary.PriceClass = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Enabled", targetDepth))
                    {
                        streamingDistributionSummary.Enabled = BoolUnmarshaller.GetInstance().Unmarshall(context);

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



            return(streamingDistributionSummary);
        }
コード例 #4
0
        public CacheBehavior Unmarshall(XmlUnmarshallerContext context)
        {
            CacheBehavior cacheBehavior = new CacheBehavior();
            int           originalDepth = context.CurrentDepth;
            int           targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("TargetOriginId", targetDepth))
                    {
                        cacheBehavior.TargetOriginId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ForwardedValues", targetDepth))
                    {
                        cacheBehavior.ForwardedValues = ForwardedValuesUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("TrustedSigners", targetDepth))
                    {
                        cacheBehavior.TrustedSigners = TrustedSignersUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ViewerProtocolPolicy", targetDepth))
                    {
                        cacheBehavior.ViewerProtocolPolicy = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("MinTTL", targetDepth))
                    {
                        cacheBehavior.MinTTL = LongUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("AllowedMethods", targetDepth))
                    {
                        cacheBehavior.AllowedMethods = AllowedMethodsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("SmoothStreaming", targetDepth))
                    {
                        cacheBehavior.SmoothStreaming = BoolUnmarshaller.GetInstance().Unmarshall(context);

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



            return(cacheBehavior);
        }