Exemplo n.º 1
0
        public DownloadHandle(
            string name,
            string downloadPath,
            ref FileHash hash,
            Loader.OnError onError,
            int retryCount,
            int timeoutSeconds,
            System.Action <int> onProgress,
            StorageCache storageCache,
            FileWriter fileWriter)
        {
            Debug.Assert(name != null);
            Debug.Assert(downloadPath != null);
            Debug.Assert(onError != null);
            Debug.Assert(storageCache != null);
            Debug.Assert(fileWriter != null);

            this.name       = name;
            _onError        = onError;
            _downloadPath   = downloadPath;
            _hash           = hash;
            _restRetryCount = retryCount;
            _timeoutSeconds = timeoutSeconds;
            _onProgress     = onProgress;
            _storageCache   = storageCache;
            _fileWriter     = fileWriter;
        }
Exemplo n.º 2
0
        public FileHandle(
            string name,
            string storageCachePath,
            DownloadHandle downloadHandle,
            Loader.OnError onError,
            FileHandle[] dependencies)
        {
            Debug.Assert(name != null);
            Debug.Assert(storageCachePath != null);
            Debug.Assert(onError != null);
            this.name           = name;
            _onError            = onError;
            _storageCachePath   = storageCachePath;
            this.downloadHandle = downloadHandle;
            this.dependencies   = dependencies;
            if (dependencies != null)
            {
                for (int i = 0; i < dependencies.Length; i++)
                {
                    dependencies[i].IncrementReference();
                }
            }

            if (this.downloadHandle == null)
            {
                Start();
            }
            else
            {
                this.downloadHandle.IncrementReference();
            }
        }
Exemplo n.º 3
0
        public AssetHandle(
            FileHandle fileHandle,
            string name,
            string dictionaryKey,
            Type type,
            Loader.OnError onError)
        {
            Debug.Assert(fileHandle != null);
            Debug.Assert(name != null);
            Debug.Assert(dictionaryKey != null);
            Debug.Assert(onError != null);

            this.fileHandle = fileHandle;
            this.fileHandle.IncrementReference();
            this.name          = name;
            _type              = type;
            this.dictionaryKey = dictionaryKey;
            _onError           = onError;
        }
Exemplo n.º 4
0
        public FileHandle(
            string name,
            string storageCachePath,
            DownloadHandle downloadHandle,
            Loader.OnError onError)
        {
            Debug.Assert(name != null);
            Debug.Assert(storageCachePath != null);
            Debug.Assert(onError != null);
            this.name           = name;
            _onError            = onError;
            _storageCachePath   = storageCachePath;
            this.downloadHandle = downloadHandle;

            if (this.downloadHandle == null)
            {
                Start();
            }
            else
            {
                this.downloadHandle.IncrementReference();
            }
        }