public DetachedResponseProfile(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "name": this._Name = propertyNode.InnerText; continue; case "type": this._Type = (ResponseProfileType)ParseEnum(typeof(ResponseProfileType), propertyNode.InnerText); continue; case "fields": this._Fields = propertyNode.InnerText; continue; case "filter": this._Filter = ObjectFactory.Create <RelatedFilter>(propertyNode); continue; case "pager": this._Pager = ObjectFactory.Create <FilterPager>(propertyNode); continue; case "relatedProfiles": this._RelatedProfiles = new List <DetachedResponseProfile>(); foreach (XmlElement arrayNode in propertyNode.ChildNodes) { this._RelatedProfiles.Add(ObjectFactory.Create <DetachedResponseProfile>(arrayNode)); } continue; case "mappings": this._Mappings = new List <ResponseProfileMapping>(); foreach (XmlElement arrayNode in propertyNode.ChildNodes) { this._Mappings.Add(ObjectFactory.Create <ResponseProfileMapping>(arrayNode)); } continue; } } }
public DetachedResponseProfile(JToken node) : base(node) { if (node["name"] != null) { this._Name = node["name"].Value <string>(); } if (node["type"] != null) { this._Type = (ResponseProfileType)ParseEnum(typeof(ResponseProfileType), node["type"].Value <string>()); } if (node["fields"] != null) { this._Fields = node["fields"].Value <string>(); } if (node["filter"] != null) { this._Filter = ObjectFactory.Create <RelatedFilter>(node["filter"]); } if (node["pager"] != null) { this._Pager = ObjectFactory.Create <FilterPager>(node["pager"]); } if (node["relatedProfiles"] != null) { this._RelatedProfiles = new List <DetachedResponseProfile>(); foreach (var arrayNode in node["relatedProfiles"].Children()) { this._RelatedProfiles.Add(ObjectFactory.Create <DetachedResponseProfile>(arrayNode)); } } if (node["mappings"] != null) { this._Mappings = new List <ResponseProfileMapping>(); foreach (var arrayNode in node["mappings"].Children()) { this._Mappings.Add(ObjectFactory.Create <ResponseProfileMapping>(arrayNode)); } } }