public async Task OpenSolutionAsync(string path) { if (CurrentSolution != null) { await CloseSolutionAsync(); } if (System.IO.File.Exists(path)) { var extension = System.IO.Path.GetExtension(path); var solutionType = _solutionTypes.FirstOrDefault( s => s.Metadata.SupportedExtensions.Any(e => extension.EndsWith(e))); if (solutionType != null) { StatusBar.SetText($"Loading Solution: {path}"); var solution = await solutionType.Value.LoadAsync(path); await solution.LoadSolutionAsync(); await solution.RestoreSolutionAsync(); StatusBar.ClearText(); CurrentSolution = solution; await CurrentSolution.LoadProjectsAsync(); } } }
public async Task OpenSolutionAsync(string path) { if (CurrentSolution != null) { await CloseSolutionAsync(); } if (System.IO.File.Exists(path)) { var solutionType = SolutionTypes.FirstOrDefault(st => st.Extensions.Contains(System.IO.Path.GetExtension(path).Substring(1))); if (solutionType != null) { StatusBar.SetText($"Loading Solution: {path}"); var solution = await solutionType.LoadAsync(path); await solution.LoadSolutionAsync(); await solution.RestoreSolutionAsync(); StatusBar.ClearText(); CurrentSolution = solution; await CurrentSolution.LoadProjectsAsync(); } } }