public CreateGroupResult Unmarshall(UnmarshallerContext 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(UnmarshallerContext 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); }