private void InformAboutFilteredOutProjects()
{
var includedProjects = this.BindingProjects.ToList();
var excludedProjects = this.projectSystem.GetSolutionProjects().Except(this.BindingProjects).ToList();
var output = new StringBuilder();
output.AppendFormat(Strings.SubTextPaddingFormat, Strings.DiscoveringSolutionIncludedProjectsHeader).AppendLine();
if (includedProjects.Count == 0)
{
var message = string.Format(Strings.DiscoveredIncludedOrExcludedProjectFormat, Strings.NoProjectsApplicableForBinding);
output.AppendFormat(Strings.SubTextPaddingFormat, message).AppendLine();
}
else
{
includedProjects.ForEach(
p =>
{
var message = string.Format(Strings.DiscoveredIncludedOrExcludedProjectFormat, p.UniqueName);
output.AppendFormat(Strings.SubTextPaddingFormat, message).AppendLine();
});
}
output.AppendFormat(Strings.SubTextPaddingFormat, Strings.DiscoveringSolutionExcludedProjectsHeader).AppendLine();
if (excludedProjects.Count == 0)
{
var message = string.Format(Strings.DiscoveredIncludedOrExcludedProjectFormat, Strings.NoProjectsExcludedFromBinding);
output.AppendFormat(Strings.SubTextPaddingFormat, message).AppendLine();
}
else
{
excludedProjects.ForEach(
p =>
{
var message = string.Format(Strings.DiscoveredIncludedOrExcludedProjectFormat, p.UniqueName);
output.AppendFormat(Strings.SubTextPaddingFormat, message).AppendLine();
});
}
output.AppendFormat(Strings.SubTextPaddingFormat, Strings.FilteredOutProjectFromBindingEnding);
VsShellUtils.WriteToSonarLintOutputPane(this.host, output.ToString());
}