private static void UnmarshallResult(XmlUnmarshallerContext context, CreateGroupResponse 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("Group", targetDepth)) { response.Group = GroupUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }
public CreateGroupResult Unmarshall(XmlUnmarshallerContext context) { CreateGroupResult createGroupResult = new CreateGroupResult(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Group", targetDepth)) { createGroupResult.Group = GroupUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(createGroupResult); } } return(createGroupResult); }
public static GroupUnmarshaller GetInstance() { if (instance == null) { instance = new GroupUnmarshaller(); } return(instance); }
public GetGroupResult Unmarshall(XmlUnmarshallerContext context) { GetGroupResult getGroupResult = new GetGroupResult(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Group", targetDepth)) { getGroupResult.Group = GroupUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Users/member", targetDepth)) { getGroupResult.Users.Add(UserUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("IsTruncated", targetDepth)) { getGroupResult.IsTruncated = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Marker", targetDepth)) { getGroupResult.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(getGroupResult); } } return(getGroupResult); }
private static void UnmarshallResult(XmlUnmarshallerContext context, ListGroupsResponse 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("Groups/member", targetDepth)) { response.Groups.Add(GroupUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("IsTruncated", targetDepth)) { response.IsTruncated = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Marker", targetDepth)) { response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }