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 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 static DomainConfigurationUnmarshaller GetInstance() { if (instance == null) { instance = new DomainConfigurationUnmarshaller(); } return(instance); }