public static CacheNodeTypeSpecificValueUnmarshaller GetInstance() { if (instance == null) { instance = new CacheNodeTypeSpecificValueUnmarshaller(); } return(instance); }
public CacheNodeTypeSpecificParameter Unmarshall(XmlUnmarshallerContext context) { CacheNodeTypeSpecificParameter cacheNodeTypeSpecificParameter = new CacheNodeTypeSpecificParameter(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("ParameterName", targetDepth)) { cacheNodeTypeSpecificParameter.ParameterName = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Description", targetDepth)) { cacheNodeTypeSpecificParameter.Description = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Source", targetDepth)) { cacheNodeTypeSpecificParameter.Source = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("DataType", targetDepth)) { cacheNodeTypeSpecificParameter.DataType = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("AllowedValues", targetDepth)) { cacheNodeTypeSpecificParameter.AllowedValues = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("IsModifiable", targetDepth)) { cacheNodeTypeSpecificParameter.IsModifiable = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("MinimumEngineVersion", targetDepth)) { cacheNodeTypeSpecificParameter.MinimumEngineVersion = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("CacheNodeTypeSpecificValues/CacheNodeTypeSpecificValue", targetDepth)) { cacheNodeTypeSpecificParameter.CacheNodeTypeSpecificValues.Add(CacheNodeTypeSpecificValueUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(cacheNodeTypeSpecificParameter); } } return(cacheNodeTypeSpecificParameter); }