public static BundleTaskErrorUnmarshaller GetInstance() { if (instance == null) { instance = new BundleTaskErrorUnmarshaller(); } return(instance); }
public BundleTask Unmarshall(XmlUnmarshallerContext context) { BundleTask bundleTask = new BundleTask(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 1; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("instanceId", targetDepth)) { bundleTask.InstanceId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("bundleId", targetDepth)) { bundleTask.BundleId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("state", targetDepth)) { bundleTask.State = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("startTime", targetDepth)) { bundleTask.StartTime = DateTimeUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("updateTime", targetDepth)) { bundleTask.UpdateTime = DateTimeUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("storage", targetDepth)) { bundleTask.Storage = StorageUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("progress", targetDepth)) { bundleTask.Progress = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("error", targetDepth)) { bundleTask.BundleTaskError = BundleTaskErrorUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(bundleTask); } } return(bundleTask); }