Пример #1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, DisableSnapshotCopyResponse 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("Cluster", targetDepth))
                    {
                        response.Cluster = ClusterUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }
        }
        public CreateClusterResult Unmarshall(XmlUnmarshallerContext context)
        {
            CreateClusterResult result = new CreateClusterResult();

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

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

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



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

            return(instance);
        }
Пример #4
0
        public DescribeClustersResult Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeClustersResult describeClustersResult = new DescribeClustersResult();
            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))
                    {
                        describeClustersResult.Marker = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Clusters/Cluster", targetDepth))
                    {
                        describeClustersResult.Clusters.Add(ClusterUnmarshaller.GetInstance().Unmarshall(context));

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



            return(describeClustersResult);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeClustersResponse 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("Marker", targetDepth))
                    {
                        response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Clusters/Cluster", targetDepth))
                    {
                        response.Clusters.Add(ClusterUnmarshaller.GetInstance().Unmarshall(context));

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



            return;
        }