public static ContentsItemUnmarshaller GetInstance() { if (instance == null) { instance = new ContentsItemUnmarshaller(); } return(instance); }
private static void UnmarshallResult(XmlUnmarshallerContext context, ListObjectsResponse 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("IsTruncated", targetDepth)) { response.IsTruncated = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("NextMarker", targetDepth)) { response.NextMarker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Contents", targetDepth)) { response.S3Objects.Add(ContentsItemUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("Name", targetDepth)) { response.Name = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Prefix", targetDepth)) { response.Prefix = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Delimiter", targetDepth)) { response.Delimiter = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("MaxKeys", targetDepth)) { response.MaxKeys = IntUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("CommonPrefixes", targetDepth)) { var prefix = CommonPrefixesItemUnmarshaller.GetInstance().Unmarshall(context); if (prefix != null) { response.CommonPrefixes.Add(prefix); } continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }