internal void UpdateThumb() { try { var overwrite = Keyboard.Modifiers == ModifierKeys.Alt ? true : false; HistoryItems.UpdateTilesImage(overwrite); this.DoEvents(); } catch (Exception ex) { ex.ERROR("UpdateThumb"); } }
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(); } }
private void ActionRefresh_Click(object sender, RoutedEventArgs e) { if (sender is MenuItem) { var overwrite = Keyboard.Modifiers == ModifierKeys.Alt ? true : false; var m = sender as MenuItem; var host = (m.Parent as ContextMenu).PlacementTarget; if (m.Uid.Equals("ActionRefresh", StringComparison.CurrentCultureIgnoreCase)) { if (host == HistoryItems) { ShowHistory(overwrite); } } else if (m.Uid.Equals("ActionRefreshThumb", StringComparison.CurrentCultureIgnoreCase)) { if (host == HistoryItems) { HistoryItems.UpdateTilesImage(overwrite); } } } }