예제 #1
0
 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);
 }
예제 #2
0
 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++;
     }
 }