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;
      }
    }
Esempio n. 2
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);
            }
        }