コード例 #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);
     }
 }
コード例 #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);
        }
コード例 #3
0
ファイル: Asset.cs プロジェクト: klyed/Infantry-Online-Server
 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;
 }