コード例 #1
0
        public void Add(IRecentItem RecentItem)
        {
            // Insert on Top
            _recentList.Insert(0, RecentItem);

            RecentItem.RemoveRequested += () => _recentList.Remove(RecentItem);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public bool CanSerialize(IRecentItem item) => item is UploadRecentItem;
コード例 #6
0
 public bool CanSerialize(IRecentItem Item) => Item is FileRecentItem;
コード例 #7
0
 public bool CanSerialize(IRecentItem Item) => Item is ImgurRecentItem;