コード例 #1
0
ファイル: HistoryPage.xaml.cs プロジェクト: netcharm/PixivWPF
 private void ShowHistory(bool overwrite = false)
 {
     try
     {
         HistoryItems.Wait();
         var setting = Application.Current.LoadSetting();
         if (HistoryItems.ItemsCount <= 0 || Keyboard.Modifiers == ModifierKeys.Control)
         {
             HistoryItems.Clear(setting.BatchClearThumbnails);
             this.DoEvents();
             HistoryItems.Items.AddRange(Application.Current.HistorySource());
             this.DoEvents();
         }
         else
         {
             UpdateLikeState();
             this.DoEvents();
             UpdateDownloadState();
             this.DoEvents();
         }
         HistoryItems.UpdateTilesImage(overwrite);
     }
     catch (Exception ex)
     {
         HistoryItems.Fail();
         if (ex is NullReferenceException)
         {
             //"No Result".ShowMessageBox("WARNING");
             "No Result".ShowToast("WARNING", tag: "ShowHistory");
         }
         else
         {
             ex.Message.ShowMessageBox("ERROR[HISTORY]");
         }
     }
     finally
     {
         HistoryItems.Ready();
         this.DoEvents();
     }
 }