18 instantiations of FormattedCell
NuGet.CommandLine.XPlat (18)
Utility\ProjectPackagesPrintUtility.cs (15)
120
p => new
FormattedCell
(p.PackageId),
121
p => new
FormattedCell
(GetAutoReferenceMarker(p, printingTransitive, ref autoReferenceFlagged)),
127
valueSelectors.Add(p => new
FormattedCell
(p?.RequestedVersion));
131
valueSelectors.Add(p => new
FormattedCell
(p.ResolvedVersion));
137
valueSelectors.Add(p => new
FormattedCell
(p.LatestVersion));
140
valueSelectors.Add(p => new
FormattedCell
(
142
valueSelectors.Add(p => new
FormattedCell
(
177
? new List<FormattedCell> { new
FormattedCell
(string.Empty, foregroundColor: null) }
185
? new List<FormattedCell> { new
FormattedCell
(string.Empty, foregroundColor: null) }
186
: vulnerabilityMetadata.Select(v => new
FormattedCell
(v.AdvisoryUrl?.ToString() ?? string.Empty, foregroundColor: null));
193
case 0: return new
FormattedCell
("Low", foregroundColor: null); // default color for low severity
194
case 1: return new
FormattedCell
("Moderate", foregroundColor: ConsoleColor.Yellow);
195
case 2: return new
FormattedCell
("High", foregroundColor: ConsoleColor.Red);
196
case 3: return new
FormattedCell
("Critical", foregroundColor: ConsoleColor.Red);
199
return new
FormattedCell
(string.Empty, foregroundColor: null);
Utility\TableParser.cs (3)
37
headers.AddRange(columnHeaders.Select(h => new
FormattedCell
(h)));
109
formattedDataCell = new
FormattedCell
();
137
stringTable.Add(new
FormattedCell
(Environment.NewLine));
29 references to FormattedCell
NuGet.CommandLine.XPlat (29)
Utility\FormattedCell.cs (3)
11
internal class FormattedCell : IEquatable<
FormattedCell
>
24
public bool Equals(
FormattedCell
other) => Value == other?.Value && ForegroundColor == other?.ForegroundColor;
26
public override bool Equals(object obj) => Equals(obj as
FormattedCell
);
Utility\ProjectPackagesPrintUtility.cs (8)
103
internal static IEnumerable<
FormattedCell
> BuildPackagesTable(
157
internal static void PrintPackagesTable(IEnumerable<
FormattedCell
> tableToPrint)
159
foreach (
var
formattedCell in tableToPrint)
173
internal static IEnumerable<
FormattedCell
> PrintVulnerabilitiesSeverities(
177
? new List<
FormattedCell
> { new FormattedCell(string.Empty, foregroundColor: null) }
181
internal static IEnumerable<
FormattedCell
> PrintVulnerabilitiesAdvisoryUrls(
185
? new List<
FormattedCell
> { new FormattedCell(string.Empty, foregroundColor: null) }
189
private static
FormattedCell
VulnerabilityToSeverityFormattedCell(PackageVulnerabilityMetadata vulnerability)
Utility\TableParser.cs (18)
16
internal static IEnumerable<
FormattedCell
> ToStringTable<T>(
24
internal static IEnumerable<
FormattedCell
> ToFormattedStringTable<T>(
29
var stringTable = new List<List<
FormattedCell
>>();
36
var headers = new List<
FormattedCell
>();
42
var columnQueues = new Dictionary<int, Queue<
FormattedCell
>>();
46
var row = new List<
FormattedCell
>();
54
var queue = new Queue<
FormattedCell
>();
57
if (dataCell is
FormattedCell
formattedDataCell)
82
if (data is
FormattedCell
formattedDataCell)
95
var subsequentRow = new List<
FormattedCell
>();
98
var
formattedDataCell = (
FormattedCell
)null;
122
internal static IEnumerable<
FormattedCell
> ToPaddedStringTable(IEnumerable<ICollection<
FormattedCell
>> values)
125
var stringTable = new List<
FormattedCell
>();
130
foreach (
var
dataCell in row)
143
private static int[] GetMaxColumnsWidth(IEnumerable<ICollection<
FormattedCell
>> values)
155
foreach (
var
formattedDataCell in row)