Exemple #1
0
 public void DownloadAsset(AssetDownloader.AssetDescriptor asset)
 {
     if (asset == null)
     {
         throw new ArgumentNullException("asset");
     }
     if (this.isAssetDownloading)
     {
         this.downloadQueue.Enqueue(asset);
     }
     else
     {
         this._DownloadAsset(asset);
     }
 }
Exemple #2
0
        private void _DownloadAsset(AssetDownloader.AssetDescriptor asset)
        {
            this.webClient = new WebClient();
            this.webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(this.ProgressChanged);
            this.webClient.DownloadDataCompleted   += new DownloadDataCompletedEventHandler(this.Completed);
            this.currentDescriptor = asset;
            try
            {
                this.webClient.DownloadDataAsync(new Uri(this.baseDirectoryUrl + asset.Name + asset.Compression));
            }
            catch (Exception e)
            { int num3 = (int)MessageBox.Show(e.ToString()); }

            this.isAssetDownloading = true;
            this.OnAssetDownloadBegin(asset);
        }
 public Asset(string fileName, byte[] data, AssetDownloader.AssetDescriptor descriptor)
 {
     if (fileName == null)
     {
         throw new ArgumentNullException("fileName");
     }
     if (descriptor == null)
     {
         throw new ArgumentNullException("descriptor");
     }
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     this.FileName   = fileName;
     this.Data       = data;
     this.Descriptor = descriptor;
 }