public static AllowedMethodsUnmarshaller GetInstance() { if (instance == null) { instance = new AllowedMethodsUnmarshaller(); } return(instance); }
public DefaultCacheBehavior Unmarshall(XmlUnmarshallerContext context) { DefaultCacheBehavior defaultCacheBehavior = new DefaultCacheBehavior(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("TargetOriginId", targetDepth)) { defaultCacheBehavior.TargetOriginId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ForwardedValues", targetDepth)) { defaultCacheBehavior.ForwardedValues = ForwardedValuesUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("TrustedSigners", targetDepth)) { defaultCacheBehavior.TrustedSigners = TrustedSignersUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ViewerProtocolPolicy", targetDepth)) { defaultCacheBehavior.ViewerProtocolPolicy = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("MinTTL", targetDepth)) { defaultCacheBehavior.MinTTL = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("AllowedMethods", targetDepth)) { defaultCacheBehavior.AllowedMethods = AllowedMethodsUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(defaultCacheBehavior); } } return(defaultCacheBehavior); }