private static void PrintScore(Score score, int padTo) { var pre = score.PackageName; while (pre.Length < padTo + 5) pre += " "; Console.WriteLine("{0} :: {1}", pre, score.UsageCount); }
protected void AddOrIncrement(string packageName) { var existing = Scores.FirstOrDefault(s => s.PackageName == packageName); if (existing == null) { existing = new Score(packageName); Scores.Add(existing); } else { existing.UsageCount++; } }