コード例 #1
0
        void executeRequestForResource(PictureAd ad, ImageOrientation imageOrientation, ImageType imageType)
        {
            string filePath = ad.getLocalImageURL(imageOrientation, imageType);

            if (System.IO.File.Exists(filePath))
            {
                downloadedResourcesCount++;
                if (downloadedResourcesCount == PictureAd.expectedResourcesCount)
                {
                    _resourcesAvailable();
                    _operationCompleteDelegate();
                }
                return;
            }
            string      url = ad.getRemoteImageURL(imageOrientation, imageType);
            HTTPRequest pictureURLRequest = new HTTPRequest(url);

            pictureURLRequest.execute(pictureURLRequestResponse => {
                downloadedResourcesCount++;
                if (pictureURLRequestResponse.dataLength != 0)
                {
                    System.IO.File.WriteAllBytes(ad.getLocalImageURL(imageOrientation, imageType), pictureURLRequestResponse.data);
                }

                if (downloadedResourcesCount == PictureAd.expectedResourcesCount)
                {
                    _resourcesAvailable();
                    _operationCompleteDelegate();
                }
            });
        }
コード例 #2
0
        void executeRequestForResource(PictureAd ad, ImageOrientation imageOrientation, ImageType imageType)
        {
            string filePath = ad.getLocalImageURL(imageOrientation, imageType);

            if (System.IO.File.Exists(filePath))
            {
                downloadedResourcesCount++;
                if (downloadedResourcesCount == PictureAd.expectedResourcesCount)
                {
                    _resourcesAvailable();
                    _operationCompleteDelegate();
                }
                return;
            }
            string      url = ad.getRemoteImageURL(imageOrientation, imageType);
            HTTPRequest pictureURLRequest = new HTTPRequest(url);

            imageTypes[url]        = imageType;
            imageOrientations[url] = imageOrientation;
            HTTPManager.sendFileRequest(pictureURLRequest, HTTPFileCallback, retryDelays, 20 * 60);
        }
コード例 #3
0
		void executeRequestForResource(PictureAd ad, ImageOrientation imageOrientation, ImageType imageType) {
			string filePath = ad.getLocalImageURL(imageOrientation, imageType);
			if (System.IO.File.Exists(filePath)) {
				downloadedResourcesCount++;
				if(downloadedResourcesCount == PictureAd.expectedResourcesCount) {
					_resourcesAvailable ();
					_operationCompleteDelegate();
				}
				return;
			}
			string url = ad.getRemoteImageURL(imageOrientation, imageType);
			HTTPRequest pictureURLRequest = new HTTPRequest(url);
			pictureURLRequest.execute(pictureURLRequestResponse => {
				downloadedResourcesCount ++;
				if(pictureURLRequestResponse.dataLength != 0)
					System.IO.File.WriteAllBytes(ad.getLocalImageURL(imageOrientation, imageType), pictureURLRequestResponse.data);
				
				if(downloadedResourcesCount == PictureAd.expectedResourcesCount) {
					_resourcesAvailable ();
					_operationCompleteDelegate();
				}
			});
		}
コード例 #4
0
 void executeRequestForResource(PictureAd ad, ImageOrientation imageOrientation, ImageType imageType)
 {
     string filePath = ad.getLocalImageURL(imageOrientation, imageType);
     if (System.IO.File.Exists(filePath)) {
         downloadedResourcesCount++;
         if(downloadedResourcesCount == PictureAd.expectedResourcesCount) {
             _resourcesAvailable ();
             _operationCompleteDelegate();
         }
         return;
     }
     string url = ad.getRemoteImageURL(imageOrientation, imageType);
     HTTPRequest pictureURLRequest = new HTTPRequest(url);
     imageTypes[url] = imageType;
     imageOrientations[url] = imageOrientation;
     HTTPManager.sendFileRequest(pictureURLRequest, HTTPFileCallback, retryDelays, 20 * 60);
 }