private async void _NicoLiveCommentClient_CommentRecieved(object sender, CommentRecievedEventArgs e) { if (IsWatchWithTimeshift) { await AddCommentToCacheAsync(e.Chat); } else { _LiveComments.Add(e.Chat); } }
private async void _NicoLiveCommentClient_CommentRecieved(object sender, CommentRecievedEventArgs e) { var chat = e.Chat; await HohoemaApp.UIDispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () => { _LiveComments.Add(e.Chat); }); /* * if (chat.UserId == BroadcasterId) * { * if (chat.Content.Contains("href")) * { * var root = XDocument.Parse(chat.Content); * var anchor = root.Element("a"); * if (anchor != null) * { * var href = anchor.Attribute("href"); * var link = href.Value; * * if (chat.Content.Contains("次")) * { * var liveId = link.Split('/').LastOrDefault(); * if (NiconicoRegex.IsLiveId(liveId)) * { * // TODO: liveIdの放送情報を取得して、配信者が同一ユーザーかチェックする * using (var releaser = await _NextLiveSubscriveLock.LockAsync()) * { * await HohoemaApp.UIDispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => * { * NextLiveId = liveId; * NextLive?.Invoke(this, NextLiveId); * }); * * } * } * } * * // TODO: linkをブラウザで開けるようにする * } * } * } */ }