public MailJobData(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "mailType": this._MailType = (MailType)StringEnum.Parse(typeof(MailType), propertyNode.InnerText); continue; case "mailPriority": this._MailPriority = ParseInt(propertyNode.InnerText); continue; case "status": this._Status = (MailJobStatus)ParseEnum(typeof(MailJobStatus), propertyNode.InnerText); continue; case "recipientName": this._RecipientName = propertyNode.InnerText; continue; case "recipientEmail": this._RecipientEmail = propertyNode.InnerText; continue; case "recipientId": this._RecipientId = ParseInt(propertyNode.InnerText); continue; case "fromName": this._FromName = propertyNode.InnerText; continue; case "fromEmail": this._FromEmail = propertyNode.InnerText; continue; case "bodyParams": this._BodyParams = propertyNode.InnerText; continue; case "subjectParams": this._SubjectParams = propertyNode.InnerText; continue; case "templatePath": this._TemplatePath = propertyNode.InnerText; continue; case "language": this._Language = (LanguageCode)StringEnum.Parse(typeof(LanguageCode), propertyNode.InnerText); continue; case "campaignId": this._CampaignId = ParseInt(propertyNode.InnerText); continue; case "minSendDate": this._MinSendDate = ParseInt(propertyNode.InnerText); continue; case "isHtml": this._IsHtml = ParseBool(propertyNode.InnerText); continue; case "separator": this._Separator = propertyNode.InnerText; continue; } } }
public MailJobData(JToken node) : base(node) { if (node["mailType"] != null) { this._MailType = (MailType)StringEnum.Parse(typeof(MailType), node["mailType"].Value <string>()); } if (node["mailPriority"] != null) { this._MailPriority = ParseInt(node["mailPriority"].Value <string>()); } if (node["status"] != null) { this._Status = (MailJobStatus)ParseEnum(typeof(MailJobStatus), node["status"].Value <string>()); } if (node["recipientName"] != null) { this._RecipientName = node["recipientName"].Value <string>(); } if (node["recipientEmail"] != null) { this._RecipientEmail = node["recipientEmail"].Value <string>(); } if (node["recipientId"] != null) { this._RecipientId = ParseInt(node["recipientId"].Value <string>()); } if (node["fromName"] != null) { this._FromName = node["fromName"].Value <string>(); } if (node["fromEmail"] != null) { this._FromEmail = node["fromEmail"].Value <string>(); } if (node["bodyParams"] != null) { this._BodyParams = node["bodyParams"].Value <string>(); } if (node["subjectParams"] != null) { this._SubjectParams = node["subjectParams"].Value <string>(); } if (node["templatePath"] != null) { this._TemplatePath = node["templatePath"].Value <string>(); } if (node["language"] != null) { this._Language = (LanguageCode)StringEnum.Parse(typeof(LanguageCode), node["language"].Value <string>()); } if (node["campaignId"] != null) { this._CampaignId = ParseInt(node["campaignId"].Value <string>()); } if (node["minSendDate"] != null) { this._MinSendDate = ParseInt(node["minSendDate"].Value <string>()); } if (node["isHtml"] != null) { this._IsHtml = ParseBool(node["isHtml"].Value <string>()); } if (node["separator"] != null) { this._Separator = node["separator"].Value <string>(); } }