public IAsyncResult BeginRetrieve(CacheRequest request, AsyncCallback callback, object state)
        {
            var asyncResult = new CacheAsyncResult() { AsyncState = state, AsyncWaitHandle = new AutoResetEvent(false) };

#if SILVERLIGHT && !WINDOWS_PHONE || WINDOWS_PHONE7
            TaskEx.Run(async () =>
#else
            Task.Run(async () =>
#endif
            {
                asyncResult.Response = await downloaderPlugin.RequestAsync(request);
                asyncResult.IsCompleted = true;

                //callback
                if (callback != null)
                {
                    callback(asyncResult);
                }

                //signal the blocked SSME downloader thread waiting in EndRetrieve
                if (asyncResult.AsyncWaitHandle != null)
                {
                    (asyncResult.AsyncWaitHandle as AutoResetEvent).Set();
                }
            });

            return asyncResult;
        }
        public IAsyncResult BeginRetrieve(CacheRequest request, AsyncCallback callback, object state)
        {
            var asyncResult = new CacheAsyncResult()
            {
                AsyncState = state, AsyncWaitHandle = new AutoResetEvent(false)
            };

#if SILVERLIGHT && !WINDOWS_PHONE || WINDOWS_PHONE7
            TaskEx.Run(async() =>
#else
            Task.Run(async() =>
#endif
            {
                asyncResult.Response    = await downloaderPlugin.RequestAsync(request);
                asyncResult.IsCompleted = true;

                //callback
                if (callback != null)
                {
                    callback(asyncResult);
                }

                //signal the blocked SSME downloader thread waiting in EndRetrieve
                if (asyncResult.AsyncWaitHandle != null)
                {
                    (asyncResult.AsyncWaitHandle as AutoResetEvent).Set();
                }
            });

            return(asyncResult);
        }