public async void CleanSolutions(IList <object> solutionFolders) { if (solutionFolders.Count == 0) { return; } try { IsBusy = true; await _solutionService.Clear(solutionFolders.Cast <StorageFolder>().ToList()); _notificationService.SendToast(Constants.Messages.StoragesSuccessfullyCleared); } catch (StorageException e) { _notificationService.SendToast(Constants.Messages.CompleteWithErrors); if (e.ExceptedFolders != null) { foreach (var exceptedFolder in e.ExceptedFolders) { SolutionFolders.Remove(exceptedFolder); } } } finally { IsBusy = false; } }
public string ReadFolderPathFromConfigurationFile(SolutionFolders solutionFolder) { var folderPath = string.Empty; switch (solutionFolder) { case SolutionFolders.Logs: folderPath = Path.Combine(_solutionDir, SolutionFolders.Reports.ToString(), solutionFolder.ToString()); Log.Info($"Log folder full path selected: {folderPath}"); break; case SolutionFolders.Reports: folderPath = Path.Combine(_solutionDir, SolutionFolders.Reports.ToString(), solutionFolder.ToString()); Log.Info($"Reports folder full path selected: {folderPath}"); break; case SolutionFolders.Resources: folderPath = Path.Combine(_solutionDir, SolutionFolders.Resources.ToString(), solutionFolder.ToString()); Log.Info($"Resources folder full path selected: {folderPath}"); break; } if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); Log.Info("Directory Has Been Created " + folderPath); } return(folderPath); }
public void RemoveSolutions(IList <object> solutionFolders) { foreach (StorageFolder solutionFolder in solutionFolders) { _solutionService.Remove(solutionFolder); } SolutionFolders.RemoveRange(solutionFolders.Cast <StorageFolder>()); }
private async void AddSolution() { StorageFolder solutionFolder = await _solutionService.Pick(); if (solutionFolder != null) { SolutionFolders.Add(solutionFolder); } }
/// <summary> /// Add a solution folder to the solution /// </summary> /// public VisualStudioSolutionProjectReference AddSolutionFolder(string name, string id) { Guard.Required(name, nameof(name)); Guard.Required(id, nameof(id)); if (SolutionFolders.Any(f => f.Id == id)) { throw new InvalidOperationException(Invariant($"Solution already contains a folder with id {id}")); } return(AddProjectReference(VisualStudioProjectTypeIds.SolutionFolder, name, name, id)); }
public async Task InitializeAsync() { try { IList <StorageFolder> solutionFolders = await _solutionService.Load(); SolutionFolders.AddRange(solutionFolders); } catch (StorageException e) { _notificationService.SendToast(e.Message); } }
public SolutionFolder GetSolutionFolder(string name) { return(SolutionFolders.SingleOrDefault(x => name.Equals(x.Name, StringComparison.Ordinal))); }
/// <inheritdoc /> protected override bool IsOnForbiddenPath(string filePath) { return(SolutionFolders.FileIsInWebPartsFolder(filePath)); }