Esempio n. 1
0
        private async void SpotlightContainer_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Notice("正在搜索Pixivision...");

            var article = sender.GetDataContext <SpotlightArticle>();

            var tasks  = (await PixivClient.Instance.GetArticleWorks(article.Id.ToString())).Select(PixivHelper.IllustrationInfo).Where(i => i != null);
            var result = await Task.WhenAll(tasks);

            IllustViewer.Show(result[0], result);
        }
Esempio n. 2
0
        private async void TryQuerySingle(string illustId)
        {
            if (!int.TryParse(illustId, out _))
            {
                Notice(Externally.InputIllegal("单个作品"));
                return;
            }

            try
            {
                IllustViewer.Show(await PixivHelper.IllustrationInfo(illustId));
            }
            catch (ApiException exception)
            {
                if (exception.StatusCode == HttpStatusCode.NotFound || exception.StatusCode == HttpStatusCode.BadRequest)
                {
                    Notice(Externally.IdDoNotExists);
                }
                else
                {
                    throw;
                }
            }
        }
Esempio n. 3
0
 private void IllustrationContainer_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     IllustViewer.Show(sender.GetDataContext <Illustration>(), ImageListView.ItemsSource as IEnumerable <Illustration>);
 }
Esempio n. 4
0
 private void ToDownloadListViewItem_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     IllustViewer.Show(sender.GetDataContext <Illustration>(), DownloadList.ToDownloadList);
 }