public static AliasTargetUnmarshaller GetInstance() { if (instance == null) { instance = new AliasTargetUnmarshaller(); } return(instance); }
public ResourceRecordSet Unmarshall(XmlUnmarshallerContext context) { ResourceRecordSet resourceRecordSet = new ResourceRecordSet(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Name", targetDepth)) { resourceRecordSet.Name = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { resourceRecordSet.Type = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("SetIdentifier", targetDepth)) { resourceRecordSet.SetIdentifier = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Weight", targetDepth)) { resourceRecordSet.Weight = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Region", targetDepth)) { resourceRecordSet.Region = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Failover", targetDepth)) { resourceRecordSet.Failover = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("TTL", targetDepth)) { resourceRecordSet.TTL = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ResourceRecords/ResourceRecord", targetDepth)) { resourceRecordSet.ResourceRecords.Add(ResourceRecordUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("AliasTarget", targetDepth)) { resourceRecordSet.AliasTarget = AliasTargetUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("HealthCheckId", targetDepth)) { resourceRecordSet.HealthCheckId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(resourceRecordSet); } } return(resourceRecordSet); }