Пример #1
0
        public CreateDBSnapshotResult Unmarshall(UnmarshallerContext context)
        {
            CreateDBSnapshotResult result = new CreateDBSnapshotResult();

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

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

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


            return(result);
        }
        public DescribeDBSnapshotsResult Unmarshall(UnmarshallerContext context)
        {
            DescribeDBSnapshotsResult describeDBSnapshotsResult = new DescribeDBSnapshotsResult();
            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))
                    {
                        describeDBSnapshotsResult.Marker = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("DBSnapshots/DBSnapshot", targetDepth))
                    {
                        describeDBSnapshotsResult.DBSnapshots.Add(DBSnapshotUnmarshaller.GetInstance().Unmarshall(context));

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

            return(describeDBSnapshotsResult);
        }