private void ActionJumpSelected_Click(object sender, RoutedEventArgs e) { try { var item = HistoryItems.GetSelected(WithSelectionOrder: true).LastOrDefault(); if (item.IsWork()) { Application.Current.GetMainWindow().JumpTo(item.ID); } } catch (Exception ex) { ex.ERROR(); } }
public void Copy() { List <string> info = new List <string>(); foreach (var item in HistoryItems.GetSelected(WithSelectionOrder: false, NonForAll: true)) { if (item.IsUser()) { info.Add($"UID:{item.ID}, UNAME:{item.User.Name}"); } else if (item.IsWork()) { info.Add($"ID:{item.ID}, Title:{item.Illust.Title}, UID:{item.UserID}, UNAME:{item.User.Name}"); } } Commands.CopyText.Execute(string.Join(Environment.NewLine, info)); }
private void ActionFollowAuthor_Click(object sender, RoutedEventArgs e) { string uid = (sender as dynamic).Uid; try { if (uid.Equals("ActionLikeUser", StringComparison.CurrentCultureIgnoreCase) || uid.Equals("ActionLikeUserPrivate", StringComparison.CurrentCultureIgnoreCase) || uid.Equals("ActionUnLikeUser", StringComparison.CurrentCultureIgnoreCase)) { IList <PixivItem> items = new List <PixivItem>(); var host = ((sender as MenuItem).Parent as ContextMenu).PlacementTarget; if (host == HistoryItems) { items = HistoryItems.GetSelected(); } try { if (uid.Equals("ActionLikeUser", StringComparison.CurrentCultureIgnoreCase)) { items.LikeUser(); } else if (uid.Equals("ActionLikeUserPrivate", StringComparison.CurrentCultureIgnoreCase)) { items.LikeUser(false); } else if (uid.Equals("ActionUnLikeUser", StringComparison.CurrentCultureIgnoreCase)) { items.UnLikeUser(); } } catch (Exception ex) { ex.ERROR(); } } } catch (Exception ex) { ex.ERROR(); } }