public ModerationFlag(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 "userId": this._UserId = propertyNode.InnerText; continue; case "moderationObjectType": this._ModerationObjectType = (ModerationObjectType)StringEnum.Parse(typeof(ModerationObjectType), propertyNode.InnerText); continue; case "flaggedEntryId": this._FlaggedEntryId = propertyNode.InnerText; continue; case "flaggedUserId": this._FlaggedUserId = propertyNode.InnerText; continue; case "status": this._Status = (ModerationFlagStatus)StringEnum.Parse(typeof(ModerationFlagStatus), propertyNode.InnerText); continue; case "comments": this._Comments = propertyNode.InnerText; continue; case "flagType": this._FlagType = (ModerationFlagType)ParseEnum(typeof(ModerationFlagType), propertyNode.InnerText); continue; case "createdAt": this._CreatedAt = ParseInt(propertyNode.InnerText); continue; case "updatedAt": this._UpdatedAt = ParseInt(propertyNode.InnerText); continue; } } }
public ModerationFlag(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["userId"] != null) { this._UserId = node["userId"].Value <string>(); } if (node["moderationObjectType"] != null) { this._ModerationObjectType = (ModerationObjectType)StringEnum.Parse(typeof(ModerationObjectType), node["moderationObjectType"].Value <string>()); } if (node["flaggedEntryId"] != null) { this._FlaggedEntryId = node["flaggedEntryId"].Value <string>(); } if (node["flaggedUserId"] != null) { this._FlaggedUserId = node["flaggedUserId"].Value <string>(); } if (node["status"] != null) { this._Status = (ModerationFlagStatus)StringEnum.Parse(typeof(ModerationFlagStatus), node["status"].Value <string>()); } if (node["comments"] != null) { this._Comments = node["comments"].Value <string>(); } if (node["flagType"] != null) { this._FlagType = (ModerationFlagType)ParseEnum(typeof(ModerationFlagType), node["flagType"].Value <string>()); } if (node["createdAt"] != null) { this._CreatedAt = ParseInt(node["createdAt"].Value <string>()); } if (node["updatedAt"] != null) { this._UpdatedAt = ParseInt(node["updatedAt"].Value <string>()); } }