Exemplo n.º 1
0
        private LoaderBase CreateLoaderCore()
        {
            LoaderBase loader = CreateLoader();

            loader.ContentLoader = this;
            return(loader);
        }
 public ContentLoaderAsyncResult(object asyncState, LoaderBase loader, AsyncCallback callback)
 {
   AsyncState = asyncState;
   Loader = loader;
   Lock = new object();
   Callback = callback;
   AsyncWaitHandle = new AutoResetEvent(false);
 }
 public ContentLoaderAsyncResult(object asyncState, LoaderBase loader, AsyncCallback callback)
 {
     AsyncState      = asyncState;
     Loader          = loader;
     Lock            = new object();
     Callback        = callback;
     AsyncWaitHandle = new AutoResetEvent(false);
 }
Exemplo n.º 4
0
        public IAsyncResult BeginLoad(Uri targetUri, Uri currentUri, AsyncCallback userCallback, object asyncState)
        {
            LoaderBase loader = CreateLoaderCore();
            var        result = new ContentLoaderAsyncResult(asyncState, loader, userCallback);

            result.BeginLoadCompleted = false;
            loader.Result             = result;

            lock (result.Lock)
            {
                loader.Load(targetUri, currentUri);
                result.BeginLoadCompleted = true;
                return(result);
            }
        }