Exemple #1
0
        private void dispatchEvent(string type, Download download = null)
        {
            DownloadManagerEvent e = new DownloadManagerEvent(this, download);

            switch (type)
            {
            case DOWNLOAD_DID_FINISH_LOADING:
                if (DownloadDidFinishLoading != null)
                {
                    DownloadDidFinishLoading(this, e);
                }
                break;

            case DOWNLOAD_DID_FAIL:
                if (DownloadDidFail != null)
                {
                    DownloadDidFail(this, e);
                }
                break;

            case DOWNLOAD_DID_RECEIVE_DATA:
                if (DownloadDidReceiveData != null)
                {
                    DownloadDidReceiveData(this, e);
                }
                break;

            case DOWNLOAD_DID_START:
                if (DownloadDidStart != null)
                {
                    DownloadDidStart(this, e);
                }
                break;

            case DOWNLOADMANAGER_DID_FINISH_LOADING_ALL:
                if (DownloadDidFinishLoadingAll != null)
                {
                    DownloadDidFinishLoadingAll(this, e);
                }
                break;

            case DOWNLOADMANAGER_DID_START_LOADING_ALL:
                if (DownloadDidStartLoadingAllForManager != null)
                {
                    DownloadDidStartLoadingAllForManager(this, e);
                }
                break;
            }
        }
Exemple #2
0
        public void downloadDidFailConnectivity(Download download)
        {
            this.dispatchEvent(DOWNLOAD_DID_FAIL, download);

            DownloadManagerEvent dEvent = new DownloadManagerEvent(this, download, DownloadManagerEvent.ERROR_DOWNLOAD_DID_FAIL_CONNECTIVITY);

            if (DownloadDidFail != null)
            {
                DownloadDidFail(this, dEvent);
            }

            if (!this._cancelAllInProgress)
            {
                                #if UNITY_STANDALONE
                                #else
                this.tryDownloading();
                                #endif
            }
        }
Exemple #3
0
        public void downloadDidFailNoAvailableSpace(Download download)
        {
            this.RemoveDownload(download);
            this.RemoveResolveDownloadUrl(JsonMapper.ToJson(download));

            DownloadManagerEvent dEvent = new DownloadManagerEvent(this, download, DownloadManagerEvent.ERROR_DOWNLOAD_DID_FAIL_NO_SPACE);

            if (DownloadDidFail != null)
            {
                DownloadDidFail(this, dEvent);
            }

            if (!this._cancelAllInProgress)
            {
                                #if UNITY_STANDALONE
                                #else
                this.tryDownloading();
                                #endif
            }
        }
Exemple #4
0
        private void dispatchEvent(string type, Download download = null)
        {
            DownloadManagerEvent e = new DownloadManagerEvent(this,download);
            switch (type) {

                case DOWNLOAD_DID_FINISH_LOADING:
                        if (DownloadDidFinishLoading != null) DownloadDidFinishLoading(this,e);
                        break;
                case DOWNLOAD_DID_FAIL:
                        if (DownloadDidFail != null) DownloadDidFail(this,e);
                        break;
                case DOWNLOAD_DID_RECEIVE_DATA:
                        if (DownloadDidReceiveData != null) DownloadDidReceiveData(this,e);
                        break;
                case DOWNLOAD_DID_START:
                        if (DownloadDidStart != null) DownloadDidStart(this,e);
                        break;
                case DOWNLOADMANAGER_DID_FINISH_LOADING_ALL:
                        if (DownloadDidFinishLoadingAll != null) DownloadDidFinishLoadingAll(this,e);
                        break;
                case DOWNLOADMANAGER_DID_START_LOADING_ALL:
                        if (DownloadDidStartLoadingAllForManager != null) DownloadDidStartLoadingAllForManager(this,e);
                        break;

            }
        }
Exemple #5
0
        public void downloadDidFailNoAvailableSpace(Download download)
        {
            this.RemoveDownload(download);
            this.RemoveResolveDownloadUrl(JsonMapper.ToJson(download));

            DownloadManagerEvent dEvent = new DownloadManagerEvent(this,download,DownloadManagerEvent.ERROR_DOWNLOAD_DID_FAIL_NO_SPACE);
            if (DownloadDidFail != null) DownloadDidFail(this, dEvent);

            if (!this._cancelAllInProgress) {
                #if UNITY_STANDALONE
                #else
                this.tryDownloading ();
                #endif
            }
        }
Exemple #6
0
        public void downloadDidFailConnectivity(Download download)
        {
            this.dispatchEvent (DOWNLOAD_DID_FAIL,download);

            DownloadManagerEvent dEvent = new DownloadManagerEvent(this,download,DownloadManagerEvent.ERROR_DOWNLOAD_DID_FAIL_CONNECTIVITY);
            if (DownloadDidFail != null) DownloadDidFail(this, dEvent);

            if (!this._cancelAllInProgress) {
                #if UNITY_STANDALONE
                #else
                this.tryDownloading ();
                #endif
            }
        }