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