using System; using System.Net; using JuickApi; namespace Juick.ViewModels { public class PostItem { public PostItem(Message message) { MID = message.Mid; RID = message.Rid; Username = message.User.UName; Status = string.Format("Posted on: {0}, replies: {1}", message.Timestamp, message.Replies); MessageText = HttpUtility.HtmlDecode(message.Body); if (message.Tags != null) { MessageText = string.Join(", ", message.Tags) + Environment.NewLine + MessageText; } AvatarUri = new Uri(string.Format("http://i.juick.com/as/{0}.png", message.User.Uid), UriKind.Absolute); if (message.Photo != null) { Attachment = new Uri(message.Photo.Small, UriKind.Absolute); } } public int MID {get;set;} public int RID {get;set;} public string Username {get;set;} public Uri AvatarUri {get;set;} public Uri Attachment {get;set;} public string Status {get;set;} public string MessageText { get; set; } } }