public static PolicyAttributeTypeDescriptionUnmarshaller GetInstance() { if (instance == null) { instance = new PolicyAttributeTypeDescriptionUnmarshaller(); } return(instance); }
public PolicyTypeDescription Unmarshall(XmlUnmarshallerContext context) { PolicyTypeDescription policyTypeDescription = new PolicyTypeDescription(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("PolicyTypeName", targetDepth)) { policyTypeDescription.PolicyTypeName = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Description", targetDepth)) { policyTypeDescription.Description = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("PolicyAttributeTypeDescriptions/member", targetDepth)) { policyTypeDescription.PolicyAttributeTypeDescriptions.Add(PolicyAttributeTypeDescriptionUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(policyTypeDescription); } } return(policyTypeDescription); }