Example #1
0
 public UnZipTask(UpdateObjectVector _owner, string _appname, string _source, string _destination, Action <string> _finished, Action <float> _progress)
 {
     try {
         AppName             = _appname;
         mKey                = _source;
         mUnZipObject        = new UnZipObject(_source, _destination);
         mFinished           = _finished;
         mProgress           = _progress;
         mUpdateObject       = new UpdateNeedDisObject(AppName, Update, Dispose);
         mUpdateObject.Owner = _owner;
     }
     catch (Exception _error)
     {
         DLog.LogError(_error);
     }
 }
Example #2
0
            public static bool DownLoadFileAsync(UpdateObjectVector _owner, string _appname, string _sourceurl, string _destination, bool _IsClear, Action <string, string> _finished, Action <long, long, float> _progress)
            {
                if (sDownLoadMap.ContainsKey(_sourceurl))
                {
                    DLog.LogError("有相同URL文件正在下载当中.URL = " + _sourceurl);
                    return(false);
                }
                DownLoadTask ttaskdown = new DownLoadTask(_owner, _appname, _sourceurl, _destination, _IsClear, _finished, _progress);
                bool         isstart   = ttaskdown.StartDownloadAsync();

                if (!isstart)
                {
                    ttaskdown.Dispose();
                }
                return(isstart);
            }
Example #3
0
            public static bool UnZipFileAsync(UpdateObjectVector _owner, string _appname, string _source, string _destination, Action <string> _finished, Action <float> _progress)
            {
                if (sUnZipMap.ContainsKey(_source))
                {
                    DLog.LogError("有相同文件正在解压当中.source = " + _source);
                    return(false);
                }
                UnZipTask ttaskunzip = new UnZipTask(_owner, _appname, _source, _destination, _finished, _progress);
                bool      tstart     = ttaskunzip.StartUnZipAsync();

                if (!tstart)
                {
                    ttaskunzip.Dispose();
                }
                return(tstart);
            }
Example #4
0
            public DownLoadTask(UpdateObjectVector _owner, string _key, string _sourceurl, string _destination, bool _IsClear, Action <string, string> _finished, Action <long, long, float> _progress)
            {
                try
                {
                    AppName = _key;
                    mURL    = _sourceurl;
                    mObject = new DownLoadObject(_sourceurl, _destination, _IsClear);

                    mFinished = _finished;
                    mProgress = _progress;

                    mUpdateObject       = new UpdateNeedDisObject(AppName, Update, Dispose);
                    mUpdateObject.Owner = _owner;

                    sDownLoadMap.Add(mURL, this);
                }
                catch (Exception _error)
                {
                    DLog.LogError(_error);
                }
            }