private YouTubeLiveCommentViewModel(IMessageMetadata metadata, IMessageMethods methods)
        {
            _metadata = metadata;
            _methods  = methods;
            _metadata.PropertyChanged += (s, e) =>
            {
                switch (e.PropertyName)
                {
                case nameof(_metadata.BackColor):
                    RaisePropertyChanged(nameof(Background));
                    break;

                case nameof(_metadata.ForeColor):
                    RaisePropertyChanged(nameof(Foreground));
                    break;

                case nameof(_metadata.FontFamily):
                    RaisePropertyChanged(nameof(FontFamily));
                    break;

                case nameof(_metadata.FontStyle):
                    RaisePropertyChanged(nameof(FontStyle));
                    break;

                case nameof(_metadata.FontWeight):
                    RaisePropertyChanged(nameof(FontWeight));
                    break;

                case nameof(_metadata.FontSize):
                    RaisePropertyChanged(nameof(FontSize));
                    break;

                case nameof(_metadata.IsNameWrapping):
                    RaisePropertyChanged(nameof(UserNameWrapping));
                    break;
                }
            };
            if (_metadata.User != null)
            {
                var user = _metadata.User;
                user.PropertyChanged += (s, e) =>
                {
                    switch (e.PropertyName)
                    {
                    case nameof(user.Nickname):
                        SetNickname(user);
                        RaisePropertyChanged(nameof(NameItems));
                        break;
                    }
                };
                SetNickname(user);
            }
            CommentCopyCommand  = new RelayCommand(CopyComment);
            OpenUrlCommand      = new RelayCommand(OpenUrl);
            UsernameCopyCommand = new RelayCommand(CopyUsername);
            NicknameCopyCommand = new RelayCommand(CopyNickname);
        }
コード例 #2
0
        public InfoCommentViewModel(IInfoMessage comment, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            _message = comment;

            _nameItems   = comment.NameItems;
            MessageItems = comment.CommentItems;
            //Thumbnail = comment.UserIcon;
            //Id = comment.Id?.ToString();
            //PostTime = comment.PostTime;
        }
コード例 #3
0
        public InfoCommentViewModel(IInfoMessage comment, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            _message = comment;

            _nameItems   = null;
            MessageItems = new List <IMessagePart> {
                Common.MessagePartFactory.CreateMessageText(comment.Text)
            };
            //Thumbnail = comment.UserIcon;
            //Id = comment.Id?.ToString();
            PostTime = comment.CreatedAt.ToString("HH:mm:ss");
        }
コード例 #4
0
 public McvBigoGiftViewModel(IBigoGift comment, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
     : base(metadata, methods, connectionStatus, options)
 {
     MessageItems = new List <IMessagePart>
     {
         new Common.MessageImage
         {
             Alt    = comment.GiftName,
             Height = 40,
             Width  = 40,
             Url    = comment.GiftImgUrl
         },
         Common.MessagePartFactory.CreateMessageText($"×{comment.GiftCount}")
     };
     _nameItems = Common.MessagePartFactory.CreateMessageItems(comment.Username);
     //Id = comment.Id;
     //PostTime = comment.PostedAt.ToString("HH:mm:ss");
 }
コード例 #5
0
 public NicoCommentViewModel(NicoSitePlugin.INicoDisconnected disconnected, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
     : this(disconnected as NicoSitePlugin.INicoMessage, metadata, methods, connectionStatus, options)
 {
     _message     = disconnected;
     MessageItems = Common.MessagePartFactory.CreateMessageItems(disconnected.Text);
 }
コード例 #6
0
 public NicoCommentViewModel(NicoSitePlugin.INicoEmotion item, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
     : this(item as NicoSitePlugin.INicoMessage, metadata, methods, connectionStatus, options)
 {
     //_nameItems = MessagePartFactory.CreateMessageItems(item.UserName);
     MessageItems = MessagePartFactory.CreateMessageItems(item.Content);
     PostTime     = item.PostedAt.ToString("HH:mm:ss");
     Info         = "エモーション";
 }
コード例 #7
0
 public McvMildomCommentViewModel(MildomSitePlugin.IMildomDisconnected disconnected, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
     : this(metadata, methods, connectionStatus, options)
 {
     _message     = disconnected;
     MessageItems = Common.MessagePartFactory.CreateMessageItems(disconnected.Text);
 }
コード例 #8
0
        public McvMildomCommentViewModel(MildomSitePlugin.IMildomJoinRoom item, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            var comment = item;

            _message = comment;

            _nameItems   = comment.NameItems;
            MessageItems = comment.CommentItems;
            Thumbnail    = comment.UserIcon;
            Id           = null;
            PostTime     = comment.PostedAt.ToString("HH:mm:ss");
        }
コード例 #9
0
 public LineLiveMessageContext(ILineLiveMessage message, MessageMetadata metadata, IMessageMethods methods)
 {
     Message  = message;
     Metadata = metadata;
     Methods  = methods;
 }
コード例 #10
0
        public LineLiveCommentViewModel(LineLiveSitePlugin.ILineLiveItem item, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            var comment = item;

            _message = comment;

            _nameItems   = comment.NameItems;
            MessageItems = comment.CommentItems;
            Thumbnail    = null;
            //Thumbnail = new Common.MessageImage
            //{
            //    Url = comment.UserIconUrl,
            //    Alt = "",
            //    Height = 40,//_optionsにcolumnの幅を動的に入れて、ここで反映させたい。propertyChangedはどうやって発生させるか
            //    Width = 40,
            //};
            Id       = null;
            PostTime = comment.PostTime;
        }
コード例 #11
0
        public OpenrecCommentViewModel(OpenrecSitePlugin.IOpenrecComment comment, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            _message = comment;

            _nameItems   = comment.NameItems;
            MessageItems = comment.MessageItems;
            Thumbnail    = null;
            Id           = comment.Id;
            PostTime     = comment.PostTime;
        }
コード例 #12
0
        public ShowRoomCommentViewModel(ShowRoomSitePlugin.IShowRoomLeave leave, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            _message = leave;

            //_nameItems = leave.NameItems;
            //MessageItems = leave.CommentItems;
            //Thumbnail = join..UserIcon;
            //Id = join.Id.ToString();
            //PostTime = join.PostTime;
        }
コード例 #13
0
 public ShowRoomCommentViewModel(ShowRoomSitePlugin.IShowRoomDisconnected disconnected, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
     : this(metadata, methods, connectionStatus, options)
 {
     _message     = disconnected;
     MessageItems = disconnected.CommentItems;
 }
コード例 #14
0
 public MirrativMessageContext(IMirrativMessage message, IMirrativMessageMetadata metadata, IMessageMethods methods)
 {
     Message  = message;
     Metadata = metadata;
     Methods  = methods;
 }
コード例 #15
0
 public InfoMessageContext(IInfoMessage message, InfoMessageMetadata metadata, InfoMessageMethods methods)
 {
     Message  = message;
     Metadata = metadata;
     Methods  = methods;
 }
コード例 #16
0
        //public PeriscopeCommentViewModel(PeriscopeSitePlugin.IPeriscopeItem item, IMessageMetadata metadata, IMessageMethods methods, ConnectionName connectionStatus)
        //    : this(metadata, methods, connectionStatus)
        //{
        //    var comment = item;
        //    _message = comment;

        //    _nameItems = comment.NameItems;
        //    MessageItems = comment.CommentItems;
        //    Thumbnail = new Common.MessageImage
        //    {
        //        Url = comment.UserIconUrl,
        //        Alt = "",
        //        Height = 40,//_optionsにcolumnの幅を動的に入れて、ここで反映させたい。propertyChangedはどうやって発生させるか
        //        Width = 40,
        //    };
        //    Id = comment.Id.ToString();
        //    PostTime = UnixtimeToDateTime(comment.PostedAt / 1000).ToString("HH:mm:ss");
        //}
        public PeriscopeCommentViewModel(PeriscopeSitePlugin.IPeriscopeConnected connected, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            _message     = connected;
            MessageItems = Common.MessagePartFactory.CreateMessageItems(connected.Text);
        }
コード例 #17
0
        public LineLiveCommentViewModel(LineLiveSitePlugin.ILineLiveComment comment, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            _message = comment;

            _nameItems   = comment.NameItems;
            MessageItems = comment.CommentItems;
            Thumbnail    = comment.UserIcon;
            Id           = comment.Id?.ToString();
            PostTime     = comment.PostTime;
        }
コード例 #18
0
        public OpenrecCommentViewModel(OpenrecSitePlugin.IOpenrecYell yell, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            _message = yell;

            //_nameItems = yell.NameItems;
            //MessageItems = yell.CommentItems;
            //Thumbnail = yell.UserIcon;
            //Id = yell.Id.ToString();
            //PostTime = yell.PostTime;
        }
コード例 #19
0
 public LineLiveCommentViewModel(LineLiveSitePlugin.ILineLiveDisconnected disconnected, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
     : this(metadata, methods, connectionStatus, options)
 {
     _message     = disconnected;
     MessageItems = disconnected.CommentItems;
 }
コード例 #20
0
 public MessageContext(IPeriscopeMessage message, MessageMetadata metadata, IMessageMethods methods)
 {
     Message  = message;
     Metadata = metadata;
     Methods  = methods;
 }
コード例 #21
0
        public McvMildomCommentViewModel(MildomSitePlugin.IMildomComment comment, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            _message = comment;

            _nameItems   = MessagePartFactory.CreateMessageItems(comment.UserName);
            MessageItems = comment.CommentItems;
            Thumbnail    = null;
            Id           = null;
            PostTime     = comment.PostedAt.ToString("HH:mm:ss");
        }
コード例 #22
0
        public TwicasCommentViewModel(TwicasSitePlugin.ITwicasItem item, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus)
            : this(metadata, methods, connectionStatus)
        {
            _message = item;

            _nameItems   = item.NameItems;
            MessageItems = item.CommentItems;
            Thumbnail    = item.UserIcon;
            Id           = null;
            PostTime     = null;// comment.PostTime;
            Info         = item.ItemName;
        }
コード例 #23
0
 public McvMildomCommentViewModel(MildomSitePlugin.IMildomGift gift, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
     : this(metadata, methods, connectionStatus, options)
 {
     _message     = gift;
     MessageItems = new List <IMessagePart>
     {
         new MessageImage
         {
             Alt    = gift.GiftName,
             Url    = gift.GiftUrl,
             Width  = 40,
             Height = 40,
         },
         MessagePartFactory.CreateMessageText($"を贈りました × {gift.Count}"),
     };
     _nameItems = MessagePartFactory.CreateMessageItems(gift.UserName);
     //MessageItems = comment.CommentItems;
     //Thumbnail = null;
     //Id = null;
     PostTime = gift.PostedAt.ToString("HH:mm:ss");
     Info     = gift.GiftName;
 }
コード例 #24
0
 public TwicasCommentViewModel(TwicasSitePlugin.ITwicasDisconnected disconnected, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus)
     : this(metadata, methods, connectionStatus)
 {
     _message     = disconnected;
     MessageItems = disconnected.CommentItems;
 }
コード例 #25
0
 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");
 }
コード例 #26
0
        private TwicasCommentViewModel(IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus)
        {
            _metadata = metadata;
            _methods  = methods;

            ConnectionName = connectionStatus;
            ConnectionName.PropertyChanged += (s, e) =>
            {
                switch (e.PropertyName)
                {
                case nameof(ConnectionName.Name):
                    RaisePropertyChanged(nameof(ConnectionName));
                    break;
                }
            };
            _metadata.PropertyChanged += (s, e) =>
            {
                switch (e.PropertyName)
                {
                case nameof(_metadata.BackColor):
                    RaisePropertyChanged(nameof(Background));
                    break;

                case nameof(_metadata.ForeColor):
                    RaisePropertyChanged(nameof(Foreground));
                    break;

                case nameof(_metadata.FontFamily):
                    RaisePropertyChanged(nameof(FontFamily));
                    break;

                case nameof(_metadata.FontStyle):
                    RaisePropertyChanged(nameof(FontStyle));
                    break;

                case nameof(_metadata.FontWeight):
                    RaisePropertyChanged(nameof(FontWeight));
                    break;

                case nameof(_metadata.FontSize):
                    RaisePropertyChanged(nameof(FontSize));
                    break;

                case nameof(_metadata.IsNameWrapping):
                    RaisePropertyChanged(nameof(UserNameWrapping));
                    break;

                case nameof(_metadata.IsVisible):
                    RaisePropertyChanged(nameof(IsVisible));
                    break;
                }
            };
            if (_metadata.User != null)
            {
                var user = _metadata.User;
                user.PropertyChanged += (s, e) =>
                {
                    switch (e.PropertyName)
                    {
                    case nameof(user.Nickname):
                        SetNickname(user);
                        RaisePropertyChanged(nameof(NameItems));
                        break;
                    }
                };
                SetNickname(user);
            }
        }
コード例 #27
0
 public NicoCommentViewModel(NicoSitePlugin.INicoInfo info, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
     : this(info as NicoSitePlugin.INicoMessage, metadata, methods, connectionStatus, options)
 {
     //_nameItems = MessagePartFactory.CreateMessageItems(info.UserName);
     MessageItems = MessagePartFactory.CreateMessageItems(info.Text);
     PostTime     = info.PostedAt.ToString("HH:mm:ss");
 }
コード例 #28
0
        public PeriscopeCommentViewModel(PeriscopeSitePlugin.IPeriscopeComment comment, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            _message = comment;

            _nameItems   = MessagePartFactory.CreateMessageItems(comment.DisplayName);
            MessageItems = MessagePartFactory.CreateMessageItems(comment.Text);
            Thumbnail    = null;
            Id           = comment.Id;
            PostTime     = comment.PostedAt.HasValue ? comment.PostedAt.Value.ToString("HH:mm:ss") : (string)null;
        }
コード例 #29
0
        private NicoCommentViewModel(NicoSitePlugin.INicoMessage message, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
        {
            _message  = message;
            _metadata = metadata;
            _methods  = methods;

            ConnectionName = connectionStatus;
            _options       = options;
            ConnectionName.PropertyChanged += (s, e) =>
            {
                switch (e.PropertyName)
                {
                case nameof(ConnectionName.Name):
                    RaisePropertyChanged(nameof(ConnectionName));
                    break;

                case nameof(ConnectionName.BackColor):
                    RaisePropertyChanged(nameof(Background));
                    break;

                case nameof(ConnectionName.ForeColor):
                    RaisePropertyChanged(nameof(Foreground));
                    break;
                }
            };
            options.PropertyChanged += (s, e) =>
            {
                switch (e.PropertyName)
                {
                case nameof(options.IsEnabledSiteConnectionColor):
                    RaisePropertyChanged(nameof(Background));
                    RaisePropertyChanged(nameof(Foreground));
                    break;
                }
            };
            _message.ValueChanged += (s, e) =>
            {
                if (_message is INicoComment nicoComment)
                {
                    switch (e.PropertyName)
                    {
                    case nameof(nicoComment.UserName):
                        RaisePropertyChanged(nameof(NameItems));
                        break;
                    }
                }
            };
            _metadata.PropertyChanged += (s, e) =>
            {
                switch (e.PropertyName)
                {
                case nameof(_metadata.BackColor):
                    RaisePropertyChanged(nameof(Background));
                    break;

                case nameof(_metadata.ForeColor):
                    RaisePropertyChanged(nameof(Foreground));
                    break;

                case nameof(_metadata.FontFamily):
                    RaisePropertyChanged(nameof(FontFamily));
                    break;

                case nameof(_metadata.FontStyle):
                    RaisePropertyChanged(nameof(FontStyle));
                    break;

                case nameof(_metadata.FontWeight):
                    RaisePropertyChanged(nameof(FontWeight));
                    break;

                case nameof(_metadata.FontSize):
                    RaisePropertyChanged(nameof(FontSize));
                    break;

                case nameof(_metadata.IsNameWrapping):
                    RaisePropertyChanged(nameof(UserNameWrapping));
                    break;

                case nameof(_metadata.IsVisible):
                    RaisePropertyChanged(nameof(IsVisible));
                    break;
                }
            };
            if (_metadata.User != null)
            {
                var user = _metadata.User;
                user.PropertyChanged += (s, e) =>
                {
                    switch (e.PropertyName)
                    {
                    case nameof(user.Nickname):
                        SetNickname(user);
                        RaisePropertyChanged(nameof(NameItems));
                        break;
                    }
                };
                SetNickname(user);
            }
        }
コード例 #30
0
        public PeriscopeCommentViewModel(PeriscopeSitePlugin.IPeriscopeLeave leave, IMessageMetadata metadata, IMessageMethods methods, IConnectionStatus connectionStatus, IOptions options)
            : this(metadata, methods, connectionStatus, options)
        {
            _message = leave;

            _nameItems   = MessagePartFactory.CreateMessageItems(leave.DisplayName);
            MessageItems = MessagePartFactory.CreateMessageItems(leave.Text);
            //Thumbnail = join..UserIcon;
            //Id = join.Id.ToString();
            //PostTime = join.PostTime;
        }