Exemplo n.º 1
0
 //--------------------------------------------------------Events:---------------------------------------------------------------------\\
 #region --Events--
 private void DOWNLOAD_HANDLER_DownloadStateChanged(AbstractDownloadableObject o, DownloadStateChangedEventArgs args)
 {
     if (o is ImageTable image)
     {
         ImageDBManager.INSTANCE.setImage(image);
     }
 }
Exemplo n.º 2
0
        public async Task <AbstractDownloadableObject> FindAsync(Predicate <AbstractDownloadableObject> predicate)
        {
            await DOWNLOAD_SEMA.WaitAsync();

            AbstractDownloadableObject result = await DOWNLOAD_HANDLER.FindAsync(predicate);

            DOWNLOAD_SEMA.Release();
            return(result);
        }
Exemplo n.º 3
0
 //--------------------------------------------------------Events:---------------------------------------------------------------------\\
 #region --Events--
 private void OnDownloadStateChanged(AbstractDownloadableObject o, DownloadStateChangedEventArgs args)
 {
     if (o is ChatMessageImageModel image)
     {
         using (MainDbContext ctx = new MainDbContext())
         {
             ctx.Update(image);
         }
     }
 }