public static Img GetImg(Guid id) { Img img = null; if (_store.TryGetValue(id, out img)) { if (img.MaxShow <= img.Shown || (DateTime.Now - img.Uploaded) >= new TimeSpan(24, 0, 0)) { _store.Remove(id); return(null); } } return(img); }
public static Img AddImg(byte[] bytes, int maxShow = 2) { Img img = new Img(bytes, maxShow); _store.Add(img.Id, img); return img; }