예제 #1
0
        private void OnManifestFetched(object asset, string error, object cookie)
        {
            IFileManifest fileManifest = new RemoteFileManifest();

            if (!string.IsNullOrEmpty(error))
            {
                Service.Logger.ErrorFormat("Unable to request manifest file [{0}] on attempt #{1} with the following error: {2}", new object[]
                {
                    this.manifestUrl,
                    this.loadRetryCounter,
                    error
                });
                this.RetryRequest();
                return;
            }
            if (object.ReferenceEquals(asset, null))
            {
                Service.Logger.ErrorFormat("Manifest file request [{0}] attempt #{1} yielded an empty manifest.", new object[]
                {
                    this.manifestUrl,
                    this.loadRetryCounter
                });
                this.RetryRequest();
                return;
            }
            string input = (string)asset;

            if (!fileManifest.Prepare(this.options, input))
            {
                this.onFailure(fileManifest);
                return;
            }
            this.onSuccess(fileManifest);
        }
예제 #2
0
 private void AttemptManifestRequest(uint id, object cookie)
 {
     if (++this.loadRetryCounter > 3)
     {
         IFileManifest manifest = new RemoteFileManifest();
         this.onFailure(manifest);
     }
     else
     {
         this.webManager.Fetch(this.manifestUrl, WebAssetType.StandaloneText, 0, new OnFetchDelegate(this.OnManifestFetched), null);
     }
 }