public void Add(IRecentItem RecentItem)
        {
            // Insert on Top
            _recentList.Insert(0, RecentItem);

            RecentItem.RemoveRequested += () => _recentList.Remove(RecentItem);
        }
Exemplo n.º 2
0
        public JObject Serialize(IRecentItem Item)
        {
            if (Item is ImgurRecentItem item)
            {
                return(JObject.FromObject(new ImgurRecentModel
                {
                    Link = item.Link,
                    DeleteHash = item.DeleteHash
                }));
            }

            return(null);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 5
0
 public bool CanSerialize(IRecentItem item) => item is UploadRecentItem;
 public bool CanSerialize(IRecentItem Item) => Item is FileRecentItem;
Exemplo n.º 7
0
 public bool CanSerialize(IRecentItem Item) => Item is ImgurRecentItem;