コード例 #1
0
ファイル: ImgStore.cs プロジェクト: dahermansson/QuickImg
        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);
        }
コード例 #2
0
ファイル: ImgStore.cs プロジェクト: dahermansson/QuickImg
 public static Img AddImg(byte[] bytes, int maxShow = 2)
 {
     Img img = new Img(bytes, maxShow);
       _store.Add(img.Id, img);
       return img;
 }