public async Task AutoUpdate() { using (UpdateManager updateManager = await UpdateManager.GitHubUpdateManager("https://github.com/yteruel31/projectgitmanager")) { UpdateInfo updateInfo = await updateManager.CheckForUpdate(); if (updateInfo.ReleasesToApply.Any()) { await updateManager.UpdateApp(); await _dialogCoordinatorService.ShowOkCancel("New Version", $"New version ({updateInfo.FutureReleaseEntry.Version}) !"); updateManager.KillAllExecutablesBelongingToPackage(); ProcessModule processModule = Process.GetCurrentProcess().MainModule; if (processModule != null) { string currentProcessPath = processModule.FileName; FileInfo fileInfo = new FileInfo(currentProcessPath); DirectoryInfo directory = fileInfo.Directory; FileInfo fileToLaunch = directory?.Parent?.GetFiles(fileInfo.Name).FirstOrDefault(); currentProcessPath = fileToLaunch?.FullName ?? currentProcessPath; Process.Start(currentProcessPath, Guid.NewGuid().ToString()); } Application.Current.Shutdown(); } } }
private async Task ValidateActualBranch() { bool haveConflits = await CallMapperAndReturnAsync <GitlabIssue, bool>(SelectedIssue, issue => _projectContentOrchestrator.MergeRequestFromCurrentIssueHaveConflict(issue)); if (SelectedIssue != null) { if (!haveConflits) { await CallMapperAsync <GitlabIssue>(SelectedIssue, issue => _projectContentOrchestrator.ValidateActualBranch(issue)); LoadIssues(CurrentProject); } else { await _dialogCoordinatorService.ShowOkCancel("La MergeRequest à des conflits", "Veuillez les corriger avant de continuer"); } } }