public static ParameterUnmarshaller GetInstance() { if (instance == null) { instance = new ParameterUnmarshaller(); } return(instance); }
public DefaultClusterParameters Unmarshall(XmlUnmarshallerContext context) { DefaultClusterParameters defaultClusterParameters = new DefaultClusterParameters(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } if (context.IsStartOfDocument) { targetDepth++; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("ParameterGroupFamily", targetDepth)) { defaultClusterParameters.ParameterGroupFamily = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Marker", targetDepth)) { defaultClusterParameters.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Parameters/Parameter", targetDepth)) { defaultClusterParameters.Parameters.Add(ParameterUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(defaultClusterParameters); } } return(defaultClusterParameters); }
private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeClusterParametersResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Parameters/Parameter", targetDepth)) { response.Parameters.Add(ParameterUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("Marker", targetDepth)) { response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }