private async Task <string> GetDescriptionFull(List <Dependency> list, ComponentsGroupBy showInList)
 {
     if (showInList == ComponentsGroupBy.RequiredComponents)
     {
         return(await GetDescriptionGroupByRequiredComponents(list));
     }
     else
     {
         return(await GetDescriptionGroupByDependentComponents(list));
     }
 }
示例#2
0
        private async Task CreateFileWithSolutionMissingDependencies(string filePath, Guid solutionId, ComponentsGroupBy showComponents, string showString)
        {
            try
            {
                var repository = new SolutionRepository(_service);

                var solution = await repository.GetSolutionByIdAsync(solutionId);

                string message = null;

                message = string.Format("Analyzing Solution '{0}' {1} at {2}.", solution.UniqueName, showString, DateTime.Now.ToString("G", System.Globalization.CultureInfo.CurrentCulture));

                this._iWriteToOutput.WriteToOutput(_service.ConnectionData, string.Empty);
                this._iWriteToOutput.WriteToOutput(_service.ConnectionData, string.Empty);
                this._iWriteToOutput.WriteToOutput(_service.ConnectionData, message);

                StringBuilder strFile = new StringBuilder();

                strFile.AppendLine(message);

                var dependencyRepository = new DependencyRepository(_service);

                var listComponents = await dependencyRepository.GetSolutionMissingDependenciesAsync(solution.UniqueName);

                message = string.Format("Solution '{0}' {1} {2}:", solution.UniqueName, showString, listComponents.Count.ToString());

                this._iWriteToOutput.WriteToOutput(_service.ConnectionData, string.Empty);
                this._iWriteToOutput.WriteToOutput(_service.ConnectionData, message);

                strFile
                .AppendLine()
                .AppendLine(message)
                .AppendLine();

                message = await new DependencyDescriptionHandler(_descriptor).GetDescriptionFullAsynс(listComponents, showComponents);

                strFile.AppendLine(message);

                File.WriteAllText(filePath, strFile.ToString(), new UTF8Encoding(false));
            }
            catch (Exception ex)
            {
                this._iWriteToOutput.WriteErrorToOutput(_service.ConnectionData, ex);
            }
        }
示例#3
0
 public Task CreateFileWithSolutionMissingDependenciesAsync(string filePath, Guid solutionId, ComponentsGroupBy showComponents, string showString)
 {
     return(Task.Run(() => CreateFileWithSolutionMissingDependencies(filePath, solutionId, showComponents, showString)));
 }
 public Task <string> GetDescriptionFullAsynс(List <Dependency> list, ComponentsGroupBy showInList)
 {
     return(Task.Run(async() => await GetDescriptionFull(list, showInList)));
 }
 public Task CreateFileWithSolutionDependenciesForUninstallAsync(string filePath, Guid solutionId, ComponentsGroupBy showComponents, string showString)
 {
     return(Task.Run(async() => await CreateFileWithSolutionDependenciesForUninstall(filePath, solutionId, showComponents, showString)));
 }