public NicoCommentViewModel(NicoSitePlugin.INicoComment comment, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options) : this(comment as NicoSitePlugin.INicoMessage, metadata, methods, connectionStatus, options) { //if (!string.IsNullOrEmpty(comment.UserName)) //{ // _nameItems = MessagePartFactory.CreateMessageItems(comment.UserName); //} var siteOptions = (INicoSiteOptions)metadata.SiteOptions; siteOptions.PropertyChanged += (s, e) => { switch (e.PropertyName) { case nameof(siteOptions.IsAutoSetNickname): { SetNameItems(comment, metadata, siteOptions); } break; } }; SetNameItems(comment, metadata, siteOptions); MessageItems = MessagePartFactory.CreateMessageItems(comment.Text); if (IsValudThumbnailUrl(comment.ThumbnailUrl)) { Thumbnail = new MessageImage { Url = comment.ThumbnailUrl, Height = 40, Width = 40, }; } Id = comment.Id; PostTime = comment.PostedAt.ToLocalTime().ToString("HH:mm:ss"); }
public NicoCommentViewModel(NicoSitePlugin.INicoComment comment, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options) : this(comment as NicoSitePlugin.INicoMessage, metadata, methods, connectionStatus, options) { if (!string.IsNullOrEmpty(comment.UserName)) { _nameItems = MessagePartFactory.CreateMessageItems(comment.UserName); } MessageItems = MessagePartFactory.CreateMessageItems(comment.Text); //Thumbnail = comment.UserIcon; Id = comment.Id; PostTime = comment.PostedAt.ToString("HH:mm:ss"); }
public NicoCommentViewModel(NicoSitePlugin.INicoComment comment, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options) : this(comment as NicoSitePlugin.INicoMessage, metadata, methods, connectionStatus, options) { if (!string.IsNullOrEmpty(comment.UserName)) { _nameItems = MessagePartFactory.CreateMessageItems(comment.UserName); } MessageItems = MessagePartFactory.CreateMessageItems(comment.Text); if (IsValudThumbnailUrl(comment.ThumbnailUrl)) { Thumbnail = new MessageImage { Url = comment.ThumbnailUrl, Height = 40, Width = 40, }; } Id = comment.Id; PostTime = comment.PostedAt.ToLocalTime().ToString("HH:mm:ss"); }