public static HealthCheckConfigUnmarshaller GetInstance() { if (instance == null) { instance = new HealthCheckConfigUnmarshaller(); } return(instance); }
public HealthCheck Unmarshall(XmlUnmarshallerContext context) { HealthCheck healthCheck = new HealthCheck(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Id", targetDepth)) { healthCheck.Id = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("CallerReference", targetDepth)) { healthCheck.CallerReference = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("HealthCheckConfig", targetDepth)) { healthCheck.HealthCheckConfig = HealthCheckConfigUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(healthCheck); } } return(healthCheck); }