Exemple #1
0
        public static Bitmap GetImage(long peerId)
        {
            var collection = MainDb.GetCollection <DbImage>();

            var item = collection.FindOne(o => o.PeerId == peerId);

            if (item == null)
            {
                return(null);
            }

            item.AccesDate = DateTime.Now;

            collection.Update(item);

            var path = VkDisk.ImageCacheDir + item.Name;

            return(new Bitmap(path));
        }