public Widget(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "id": this._Id = propertyNode.InnerText; continue; case "sourceWidgetId": this._SourceWidgetId = propertyNode.InnerText; continue; case "rootWidgetId": this._RootWidgetId = propertyNode.InnerText; continue; case "partnerId": this._PartnerId = ParseInt(propertyNode.InnerText); continue; case "entryId": this._EntryId = propertyNode.InnerText; continue; case "uiConfId": this._UiConfId = ParseInt(propertyNode.InnerText); continue; case "securityType": this._SecurityType = (WidgetSecurityType)ParseEnum(typeof(WidgetSecurityType), propertyNode.InnerText); continue; case "securityPolicy": this._SecurityPolicy = ParseInt(propertyNode.InnerText); continue; case "createdAt": this._CreatedAt = ParseInt(propertyNode.InnerText); continue; case "updatedAt": this._UpdatedAt = ParseInt(propertyNode.InnerText); continue; case "partnerData": this._PartnerData = propertyNode.InnerText; continue; case "widgetHTML": this._WidgetHTML = propertyNode.InnerText; continue; case "enforceEntitlement": this._EnforceEntitlement = ParseBool(propertyNode.InnerText); continue; case "privacyContext": this._PrivacyContext = propertyNode.InnerText; continue; case "addEmbedHtml5Support": this._AddEmbedHtml5Support = ParseBool(propertyNode.InnerText); continue; case "roles": this._Roles = propertyNode.InnerText; continue; } } }
public Widget(JToken node) : base(node) { if (node["id"] != null) { this._Id = node["id"].Value <string>(); } if (node["sourceWidgetId"] != null) { this._SourceWidgetId = node["sourceWidgetId"].Value <string>(); } if (node["rootWidgetId"] != null) { this._RootWidgetId = node["rootWidgetId"].Value <string>(); } if (node["partnerId"] != null) { this._PartnerId = ParseInt(node["partnerId"].Value <string>()); } if (node["entryId"] != null) { this._EntryId = node["entryId"].Value <string>(); } if (node["uiConfId"] != null) { this._UiConfId = ParseInt(node["uiConfId"].Value <string>()); } if (node["securityType"] != null) { this._SecurityType = (WidgetSecurityType)ParseEnum(typeof(WidgetSecurityType), node["securityType"].Value <string>()); } if (node["securityPolicy"] != null) { this._SecurityPolicy = ParseInt(node["securityPolicy"].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["partnerData"] != null) { this._PartnerData = node["partnerData"].Value <string>(); } if (node["widgetHTML"] != null) { this._WidgetHTML = node["widgetHTML"].Value <string>(); } if (node["enforceEntitlement"] != null) { this._EnforceEntitlement = ParseBool(node["enforceEntitlement"].Value <string>()); } if (node["privacyContext"] != null) { this._PrivacyContext = node["privacyContext"].Value <string>(); } if (node["addEmbedHtml5Support"] != null) { this._AddEmbedHtml5Support = ParseBool(node["addEmbedHtml5Support"].Value <string>()); } if (node["roles"] != null) { this._Roles = node["roles"].Value <string>(); } }