private async void DanmakuList_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!UserNameBox.FontFamily.Equals(new FontFamily("Corbel Light")) || !DanmakuContentBox.FontFamily.Equals(new FontFamily("Corbel Light"))) { OnGotFocusFontChange(UserNameBox); OnGotFocusFontChange(DanmakuContentBox); } // ReSharper disable once AssignNullToNotNullAttribute if (DanmakuList.SelectedItem != null) { var user = DanmakuList.SelectedItem as User; var id = ""; await Task.Run(() => id = BiliBiliDanmakuCrawler.DecryptHash(user.Id)); var content = $"https://space.bilibili.com/{id}"; UserNameBox.Text = content; DanmakuContentBox.Text = user.DanmakuContent; } }
private async void SearchDanmakuButton_Click(object sender, RoutedEventArgs e) { var flag = _danmakuList.Select(t => t.DanmakuContent).Contains(DanmakuContentBox.Text); if (flag) { foreach (var t in _danmakuList) { if (t.DanmakuContent == DanmakuContentBox.Text) { var id = ""; await Task.Run(() => id = BiliBiliDanmakuCrawler.DecryptHash(t.Id)); UserNameBox.Text = $"http://space.bilibili.com/{id}"; } } return; } MessageBox.Show("该弹幕不存在"); }