//Update public void StartUpdate(string sVersion) { string url = GithubHelper.getFileUrl(Global.NAME_GITHUB_AUTHOR, Global.NAME_GITHUB_PROJECT, sVersion, Global.NAME_GITHUB_FILE); if (PathHelper.Mkdirs(Global.PATH_UPDATE) == false) { Dialog.Show(new MessageView(MessageBoxImage.Error, "Creat folder falied!", false)); return; } DownloadFileHepler.StartAsync(url, Global.PATH_UPDATE + Global.NAME_GITHUB_FILE, null, UpdateDownloadNotify, CompleteDownloadNotify, ErrDownloadNotify, 3); }
//Update public void StartUpdate() { Progress.ValueInt = 0; CountIncreSize = 0; ShowProgress = Visibility.Visible; DownloadStatusInfo = Language.Get("strmsgGetNewVersionUrl"); string url = GithubHelper.getFileUrl(Global.NAME_GITHUB_AUTHOR, Global.NAME_GITHUB_PROJECT, LastVersion, Global.NAME_GITHUB_FILE); if (PathHelper.Mkdirs(Global.PATH_UPDATE) == false) { DownloadStatusInfo = Language.Get("strmsgCreatUpdateFolderFailed"); EndUpdate(); return; } DownloadStatusInfo = Language.Get("strmsgStartUpdate"); Progress.SetStatus(ProgressHelper.STATUS.RUNNING); StartTime = TimeHelper.GetCurrentTime(); LoginKey key = Tools.GetKey(); DownloadFileHepler.StartAsync(url, Global.PATH_UPDATE + Global.NAME_GITHUB_FILE, null, UpdateDownloadNotify, CompleteDownloadNotify, ErrDownloadNotify, 3, Proxy: key.Proxy); }