public static DiskImageVolumeDescriptionUnmarshaller GetInstance() { if (instance == null) { instance = new DiskImageVolumeDescriptionUnmarshaller(); } return(instance); }
public ImportVolumeTaskDetails Unmarshall(XmlUnmarshallerContext context) { ImportVolumeTaskDetails importVolumeTaskDetails = new ImportVolumeTaskDetails(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 1; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("bytesConverted", targetDepth)) { importVolumeTaskDetails.BytesConverted = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("availabilityZone", targetDepth)) { importVolumeTaskDetails.AvailabilityZone = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { importVolumeTaskDetails.Description = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("image", targetDepth)) { importVolumeTaskDetails.Image = DiskImageDescriptionUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("volume", targetDepth)) { importVolumeTaskDetails.Volume = DiskImageVolumeDescriptionUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(importVolumeTaskDetails); } } return(importVolumeTaskDetails); }