public static CustomOriginConfigUnmarshaller GetInstance() { if (instance == null) { instance = new CustomOriginConfigUnmarshaller(); } return(instance); }
public Origin Unmarshall(XmlUnmarshallerContext context) { Origin origin = new Origin(); 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)) { origin.Id = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("DomainName", targetDepth)) { origin.DomainName = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("S3OriginConfig", targetDepth)) { origin.S3OriginConfig = S3OriginConfigUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("CustomOriginConfig", targetDepth)) { origin.CustomOriginConfig = CustomOriginConfigUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(origin); } } return(origin); }