private static void UnmarshallResult(XmlUnmarshallerContext context, GetACLResponse 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("Owner", targetDepth)) { if (null == response.AccessControlList) { response.AccessControlList = new S3AccessControlList(); } response.AccessControlList.Owner = OwnerUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Grant", targetDepth + 1)) { if (null == response.AccessControlList) { response.AccessControlList = new S3AccessControlList(); } response.AccessControlList.Grants.Add(GrantUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }
private static void UnmarshallResult(XmlUnmarshallerContext context, ListBucketsResponse 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("Bucket", targetDepth + 1)) { response.Buckets.Add(BucketUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("Owner", targetDepth)) { response.Owner = OwnerUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }
public MultipartUpload Unmarshall(XmlUnmarshallerContext context) { MultipartUpload uploadsItem = new MultipartUpload(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Initiated", targetDepth)) { uploadsItem.Initiated = DateTimeUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Initiator", targetDepth)) { uploadsItem.Initiator = InitiatorUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Key", targetDepth)) { uploadsItem.Key = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Owner", targetDepth)) { uploadsItem.Owner = OwnerUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("StorageClass", targetDepth)) { uploadsItem.StorageClass = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("UploadId", targetDepth)) { uploadsItem.UploadId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(uploadsItem); } } return(uploadsItem); }
public S3Object Unmarshall(XmlUnmarshallerContext context) { S3Object contentsItem = new S3Object(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("ETag", targetDepth)) { contentsItem.ETag = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Key", targetDepth)) { contentsItem.Key = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("LastModified", targetDepth)) { contentsItem.LastModified = DateTimeUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Owner", targetDepth)) { contentsItem.Owner = OwnerUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Size", targetDepth)) { contentsItem.Size = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("StorageClass", targetDepth)) { contentsItem.StorageClass = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(contentsItem); } } return(contentsItem); }
private static void UnmarshallResult(XmlUnmarshallerContext context, ListPartsResponse 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("Bucket", targetDepth)) { response.BucketName = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Key", targetDepth)) { response.Key = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("UploadId", targetDepth)) { response.UploadId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("PartNumberMarker", targetDepth)) { response.PartNumberMarker = IntUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("NextPartNumberMarker", targetDepth)) { response.NextPartNumberMarker = IntUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("MaxParts", targetDepth)) { response.MaxParts = IntUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("IsTruncated", targetDepth)) { response.IsTruncated = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Part", targetDepth)) { response.Parts.Add(PartDetailUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("Initiator", targetDepth)) { response.Initiator = InitiatorUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Owner", targetDepth)) { response.Owner = OwnerUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("StorageClass", targetDepth)) { response.StorageClass = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }