Esempio n. 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;
            }
        }
Esempio n. 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
            }
        }
Esempio n. 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
            }
        }
Esempio n. 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;

            }
        }
Esempio n. 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
            }
        }
Esempio n. 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
            }
        }