public LiveChannelSegment(JToken node) : base(node) { if (node["id"] != null) { this._Id = ParseLong(node["id"].Value <string>()); } if (node["partnerId"] != null) { this._PartnerId = ParseInt(node["partnerId"].Value <string>()); } if (node["createdAt"] != null) { this._CreatedAt = ParseInt(node["createdAt"].Value <string>()); } if (node["updatedAt"] != null) { this._UpdatedAt = ParseInt(node["updatedAt"].Value <string>()); } if (node["name"] != null) { this._Name = node["name"].Value <string>(); } if (node["description"] != null) { this._Description = node["description"].Value <string>(); } if (node["tags"] != null) { this._Tags = node["tags"].Value <string>(); } if (node["type"] != null) { this._Type = (LiveChannelSegmentType)StringEnum.Parse(typeof(LiveChannelSegmentType), node["type"].Value <string>()); } if (node["status"] != null) { this._Status = (LiveChannelSegmentStatus)StringEnum.Parse(typeof(LiveChannelSegmentStatus), node["status"].Value <string>()); } if (node["channelId"] != null) { this._ChannelId = node["channelId"].Value <string>(); } if (node["entryId"] != null) { this._EntryId = node["entryId"].Value <string>(); } if (node["triggerType"] != null) { this._TriggerType = (LiveChannelSegmentTriggerType)StringEnum.Parse(typeof(LiveChannelSegmentTriggerType), node["triggerType"].Value <string>()); } if (node["triggerSegmentId"] != null) { this._TriggerSegmentId = ParseLong(node["triggerSegmentId"].Value <string>()); } if (node["startTime"] != null) { this._StartTime = ParseFloat(node["startTime"].Value <string>()); } if (node["duration"] != null) { this._Duration = ParseFloat(node["duration"].Value <string>()); } }
public LiveChannelSegment(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "id": this._Id = ParseLong(propertyNode.InnerText); continue; case "partnerId": this._PartnerId = ParseInt(propertyNode.InnerText); continue; case "createdAt": this._CreatedAt = ParseInt(propertyNode.InnerText); continue; case "updatedAt": this._UpdatedAt = ParseInt(propertyNode.InnerText); continue; case "name": this._Name = propertyNode.InnerText; continue; case "description": this._Description = propertyNode.InnerText; continue; case "tags": this._Tags = propertyNode.InnerText; continue; case "type": this._Type = (LiveChannelSegmentType)StringEnum.Parse(typeof(LiveChannelSegmentType), propertyNode.InnerText); continue; case "status": this._Status = (LiveChannelSegmentStatus)StringEnum.Parse(typeof(LiveChannelSegmentStatus), propertyNode.InnerText); continue; case "channelId": this._ChannelId = propertyNode.InnerText; continue; case "entryId": this._EntryId = propertyNode.InnerText; continue; case "triggerType": this._TriggerType = (LiveChannelSegmentTriggerType)StringEnum.Parse(typeof(LiveChannelSegmentTriggerType), propertyNode.InnerText); continue; case "triggerSegmentId": this._TriggerSegmentId = ParseLong(propertyNode.InnerText); continue; case "startTime": this._StartTime = ParseFloat(propertyNode.InnerText); continue; case "duration": this._Duration = ParseFloat(propertyNode.InnerText); continue; } } }