예제 #1
0
        internal async void DispatchSubmit(Action <UIImage, UIImage> action)
        {
            await Task.Factory.StartNew(() =>
            {
                lock (m_Lock)
                {
                    BitmapHunter hunter;
                    if (m_Hunters.TryGetValue(action.Key, out hunter))
                    {
                        hunter.Attach(action);
                        return;
                    }

                    hunter = BitmapHunter.ForRequest(action.Picasso, action, this, m_Cache);
                    hunter.Run();
                    m_Hunters.Add(action.Key, hunter);
                }
            });
        }
예제 #2
0
        public Bitmap Get()
        {
            if (m_Deferred)
            {
                throw new InvalidOperationException("Fit cannot be used with get");
            }

            if (!m_Data.HasImage)
            {
                return(null);
            }

            Request <Bitmap> request = CreateRequest();
            string           key     = Utils.CreateKey(request, new StringBuilder());

            Action <Bitmap, Drawable> getAction = new GetAction <Bitmap, Drawable>(m_Picasso, request, m_SkipCache, key);

            return(BitmapHunter.ForRequest(m_Picasso, getAction, m_Picasso.Dispatcher, m_Picasso.Cache).Hunt());
        }
예제 #3
0
        void PerformSubmit(Action <Bitmap, Drawable> action)
        {
            BitmapHunter hunter;

            if (m_Hunters.TryGetValue(action.Key, out hunter))
            {
                hunter.Attach(action);
                return;
            }

            if (m_Service.IsShutdown)
            {
                return;
            }

            hunter        = BitmapHunter.ForRequest(action.Picasso, action, this, m_Cache);
            hunter.Future = m_Service.Submit(hunter);
            m_Hunters.Add(action.Key, hunter);
        }