public DomainDetail Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) { return(null); } DomainDetail domainDetail = new DomainDetail(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("domainInfo", targetDepth)) { domainDetail.DomainInfo = DomainInfoUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("configuration", targetDepth)) { domainDetail.Configuration = DomainConfigurationUnmarshaller.GetInstance().Unmarshall(context); continue; } } return(domainDetail); }
public DomainInfos Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) { return(null); } DomainInfos domainInfos = new DomainInfos(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("domainInfos", targetDepth)) { var unmarshaller = new ListUnmarshaller <DomainInfo, DomainInfoUnmarshaller>( DomainInfoUnmarshaller.GetInstance()); domainInfos.Infos = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextPageToken", targetDepth)) { domainInfos.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } return(domainInfos); }
public DomainDetail Unmarshall(JsonUnmarshallerContext context) { DomainDetail domainDetail = new DomainDetail(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if ((context.IsKey) && (context.CurrentDepth == targetDepth)) { context.Read(); context.Read(); if (context.TestExpression("DomainInfo", targetDepth)) { domainDetail.DomainInfo = DomainInfoUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Configuration", targetDepth)) { domainDetail.Configuration = DomainConfigurationUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth <= originalDepth) { return(domainDetail); } } return(domainDetail); }
public static DomainInfoUnmarshaller GetInstance() { if (instance == null) { instance = new DomainInfoUnmarshaller(); } return(instance); }
public DomainInfos Unmarshall(JsonUnmarshallerContext context) { if (context.CurrentTokenType == JsonToken.Null) { return(null); } DomainInfos domainInfos = new DomainInfos(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("domainInfos", targetDepth)) { context.Read(); domainInfos.Infos = new List <DomainInfo>(); DomainInfoUnmarshaller unmarshaller = DomainInfoUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } domainInfos.Infos.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.TestExpression("nextPageToken", targetDepth)) { context.Read(); domainInfos.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.CurrentDepth <= originalDepth) { return(domainInfos); } } return(domainInfos); }
public DomainInfos Unmarshall(JsonUnmarshallerContext context) { DomainInfos domainInfos = new DomainInfos(); domainInfos.Name = null; int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if ((context.IsKey) && (context.CurrentDepth == targetDepth)) { context.Read(); context.Read(); if (context.TestExpression("DomainInfos", targetDepth)) { domainInfos.Name = new List <DomainInfo>(); DomainInfoUnmarshaller unmarshaller = DomainInfoUnmarshaller.GetInstance(); while (context.Read()) { if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth)) { domainInfos.Name.Add(unmarshaller.Unmarshall(context)); } else if (context.IsEndArray) { break; } } continue; } if (context.TestExpression("NextPageToken", targetDepth)) { domainInfos.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth <= originalDepth) { return(domainInfos); } } return(domainInfos); }