public ScheduledTaskProfile(JToken node) : base(node) { if (node["id"] != null) { this._Id = ParseInt(node["id"].Value <string>()); } if (node["partnerId"] != null) { this._PartnerId = ParseInt(node["partnerId"].Value <string>()); } if (node["name"] != null) { this._Name = node["name"].Value <string>(); } if (node["systemName"] != null) { this._SystemName = node["systemName"].Value <string>(); } if (node["description"] != null) { this._Description = node["description"].Value <string>(); } if (node["status"] != null) { this._Status = (ScheduledTaskProfileStatus)ParseEnum(typeof(ScheduledTaskProfileStatus), node["status"].Value <string>()); } if (node["objectFilterEngineType"] != null) { this._ObjectFilterEngineType = (ObjectFilterEngineType)StringEnum.Parse(typeof(ObjectFilterEngineType), node["objectFilterEngineType"].Value <string>()); } if (node["objectFilter"] != null) { this._ObjectFilter = ObjectFactory.Create <Filter>(node["objectFilter"]); } if (node["objectTasks"] != null) { this._ObjectTasks = new List <ObjectTask>(); foreach (var arrayNode in node["objectTasks"].Children()) { this._ObjectTasks.Add(ObjectFactory.Create <ObjectTask>(arrayNode)); } } if (node["createdAt"] != null) { this._CreatedAt = ParseInt(node["createdAt"].Value <string>()); } if (node["updatedAt"] != null) { this._UpdatedAt = ParseInt(node["updatedAt"].Value <string>()); } if (node["lastExecutionStartedAt"] != null) { this._LastExecutionStartedAt = ParseInt(node["lastExecutionStartedAt"].Value <string>()); } if (node["maxTotalCountAllowed"] != null) { this._MaxTotalCountAllowed = ParseInt(node["maxTotalCountAllowed"].Value <string>()); } }
public ScheduledTaskProfile(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "id": this._Id = ParseInt(propertyNode.InnerText); continue; case "partnerId": this._PartnerId = ParseInt(propertyNode.InnerText); continue; case "name": this._Name = propertyNode.InnerText; continue; case "systemName": this._SystemName = propertyNode.InnerText; continue; case "description": this._Description = propertyNode.InnerText; continue; case "status": this._Status = (ScheduledTaskProfileStatus)ParseEnum(typeof(ScheduledTaskProfileStatus), propertyNode.InnerText); continue; case "objectFilterEngineType": this._ObjectFilterEngineType = (ObjectFilterEngineType)StringEnum.Parse(typeof(ObjectFilterEngineType), propertyNode.InnerText); continue; case "objectFilter": this._ObjectFilter = ObjectFactory.Create <Filter>(propertyNode); continue; case "objectTasks": this._ObjectTasks = new List <ObjectTask>(); foreach (XmlElement arrayNode in propertyNode.ChildNodes) { this._ObjectTasks.Add(ObjectFactory.Create <ObjectTask>(arrayNode)); } continue; case "createdAt": this._CreatedAt = ParseInt(propertyNode.InnerText); continue; case "updatedAt": this._UpdatedAt = ParseInt(propertyNode.InnerText); continue; case "lastExecutionStartedAt": this._LastExecutionStartedAt = ParseInt(propertyNode.InnerText); continue; case "maxTotalCountAllowed": this._MaxTotalCountAllowed = ParseInt(propertyNode.InnerText); continue; } } }