Esempio n. 1
0
        public GetHealthCheckResult Unmarshall(XmlUnmarshallerContext context)
        {
            GetHealthCheckResult getHealthCheckResult = new GetHealthCheckResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("HealthCheck", targetDepth))
                    {
                        getHealthCheckResult.HealthCheck = HealthCheckUnmarshaller.GetInstance().Unmarshall(context);

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



            return(getHealthCheckResult);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetHealthCheckResponse 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("HealthCheck", targetDepth))
                    {
                        response.HealthCheck = HealthCheckUnmarshaller.GetInstance().Unmarshall(context);

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



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

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

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("HealthChecks/HealthCheck", targetDepth))
                    {
                        listHealthChecksResult.HealthChecks.Add(HealthCheckUnmarshaller.GetInstance().Unmarshall(context));

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

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

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

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

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



            return(listHealthChecksResult);
        }