private async void LoadConfig() { ConfigManager.ConfigManager.Init(); if (!ConfigManager.ConfigManager.GetStatementConfirmed()) { StatementGrid.Visibility = Visibility.Visible; } BiliApi.CookieCollection = ConfigManager.ConfigManager.GetCookieCollection(); SettingsBox.SetSettings(ConfigManager.ConfigManager.GetSettings()); List <DownloadInfo> infos = ConfigManager.ConfigManager.GetDownloadInfos(); foreach (DownloadInfo info in infos) { DownloadQueuePanel.Append(new DownloadTask(info)); } ResultBox.SetHistory(ConfigManager.ConfigManager.GetSearchHistory()); if (BiliApi.CookieCollection != null) { UserInfo userInfo = await UserInfo.GetUserInfoAsync(BiliApi.CookieCollection); if (userInfo != null) { ShowUserInfo(userInfo); LoginBtn.Content = "登出"; } } }
private void DownloadOptionPanel_TaskCreated(DownloadTask downloadTask) { if (DownloadQueuePanel.Append(downloadTask)) { Prompt.Text = "已添加到下载队列"; ((System.Windows.Media.Animation.Storyboard)Resources["ShowPrompt"]).Begin(); } else { Prompt.Text = "已存在于下载队列"; ((System.Windows.Media.Animation.Storyboard)Resources["ShowPrompt"]).Begin(); } }