public DescribeEnvironmentsResult Unmarshall(XmlUnmarshallerContext context) { DescribeEnvironmentsResult describeEnvironmentsResult = new DescribeEnvironmentsResult(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Environments/member", targetDepth)) { describeEnvironmentsResult.Environments.Add(EnvironmentDescriptionUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(describeEnvironmentsResult); } } return(describeEnvironmentsResult); }
private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeEnvironmentsResponse 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("Environments/member", targetDepth)) { response.Environments.Add(EnvironmentDescriptionUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }