Beispiel #1
0
        private void _NicoLiveCommentClient_CommentPosted(object sender, CommentPostedEventArgs e)
        {
            _UIScheduler.Schedule(() =>
            {
                if (e.ChatResult == ChatResult.InvalidPostkey)
                {
                    _PostKey = null;
                }

                PostCommentResult?.Invoke(this, e.ChatResult == ChatResult.Success);
            });
        }
Beispiel #2
0
        private async void _NicoLiveCommentClient_CommentPosted(object sender, CommentPostedEventArgs e)
        {
            await HohoemaApp.UIDispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (e.ChatResult == ChatResult.InvalidPostkey)
                {
                    _PostKey = null;
                }

                PostCommentResult?.Invoke(this, e.ChatResult == ChatResult.Success);
            });
        }
Beispiel #3
0
        public async Task PostComment(string message, string command, TimeSpan elapsedTime)
        {
            if (!CanPostComment)
            {
                PostCommentResult?.Invoke(this, false);
                return;
            }

            if (_NicoLiveCommentClient != null)
            {
                var userId = PlayerStatusResponse.User.Id;
                _LastCommentText = message;
                await _NicoLiveCommentClient.PostComment(message, userId, command, elapsedTime);
            }
        }
Beispiel #4
0
        public async Task PostComment(string message, string command, TimeSpan elapsedTime)
        {
            if (!CanPostComment)
            {
                PostCommentResult?.Invoke(this, false);
                return;
            }

            if (_NicoLiveCommentClient != null)
            {
                _LastCommentText = message;

                await UpdatePostKey();

                if (_PostKey == null)
                {
                    throw new Exception("failed post comment, postkey update failed, " + LiveId);
                }

                _NicoLiveCommentClient.PostComment(message, command, _PostKey, elapsedTime);
            }
        }
Beispiel #5
0
        private async void _NicoLiveCommentReciever_CommentPosted(bool isSuccess, PostChat chat)
        {
            Debug.WriteLine("コメント投稿結果:+" + isSuccess);

            await HohoemaApp.UIDispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                PostCommentResult?.Invoke(this, isSuccess);

                if (isSuccess)
                {
                    _LiveComments.Add(new Chat()
                    {
                        User_id   = chat.UserId,
                        Vpos      = chat.Vpos,
                        No        = "",
                        Mail      = chat.Mail,
                        Text      = chat.Comment,
                        Anonymity = (chat.Mail?.Contains("184") ?? false) ? "true" : null
                    });
                }
            });
        }