public void Add(IRecentItem RecentItem) { // Insert on Top _recentList.Insert(0, RecentItem); RecentItem.RemoveRequested += () => _recentList.Remove(RecentItem); }
public JObject Serialize(IRecentItem Item) { if (Item is ImgurRecentItem item) { return(JObject.FromObject(new ImgurRecentModel { Link = item.Link, DeleteHash = item.DeleteHash })); } return(null); }
public JObject Serialize(IRecentItem item) { if (item is UploadRecentItem uploadRecentItem) { return(JObject.FromObject(new UploadRecentModel { Link = uploadRecentItem.Link, DeleteHash = uploadRecentItem.DeleteHash, UploaderService = uploadRecentItem.UploaderService.UploadServiceName })); } return(null); }
public JObject Serialize(IRecentItem Item) { // Persist only if File exists or is a link. if (Item is FileRecentItem item && File.Exists(item.FileName)) { return(JObject.FromObject(new FileRecentModel { FileName = item.FileName, FileType = item.FileType })); } return(null); }
public bool CanSerialize(IRecentItem item) => item is UploadRecentItem;
public bool CanSerialize(IRecentItem Item) => Item is FileRecentItem;
public bool CanSerialize(IRecentItem Item) => Item is ImgurRecentItem;