Пример #1
0
        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;
            }
        }
Пример #2
0
        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);
        }
Пример #3
0
        public void RemoveSolutions(IList <object> solutionFolders)
        {
            foreach (StorageFolder solutionFolder in solutionFolders)
            {
                _solutionService.Remove(solutionFolder);
            }

            SolutionFolders.RemoveRange(solutionFolders.Cast <StorageFolder>());
        }
Пример #4
0
        private async void AddSolution()
        {
            StorageFolder solutionFolder = await _solutionService.Pick();

            if (solutionFolder != null)
            {
                SolutionFolders.Add(solutionFolder);
            }
        }
Пример #5
0
 /// <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));
 }
Пример #6
0
        public async Task InitializeAsync()
        {
            try
            {
                IList <StorageFolder> solutionFolders = await _solutionService.Load();

                SolutionFolders.AddRange(solutionFolders);
            }
            catch (StorageException e)
            {
                _notificationService.SendToast(e.Message);
            }
        }
Пример #7
0
 public SolutionFolder GetSolutionFolder(string name)
 {
     return(SolutionFolders.SingleOrDefault(x => name.Equals(x.Name, StringComparison.Ordinal)));
 }
Пример #8
0
 /// <inheritdoc />
 protected override bool IsOnForbiddenPath(string filePath)
 {
     return(SolutionFolders.FileIsInWebPartsFolder(filePath));
 }