DirectOutputR1
DirectOutput framework R1 for virtual pinball cabinets.
Go to:
Overview 
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
TimeSpanStatisticsList.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using DirectOutput.General.Generic;
6 
7 namespace DirectOutput.General.Statistics
8 {
9  public class TimeSpanStatisticsList:NamedItemList<TimeSpanStatisticsItem>
10  {
11 
12  new public void Sort()
13  {
14  try
15  {
16  Sort((TSI1, TSI2) => (TSI1.GroupName == TSI2.GroupName ? TSI1.Name.CompareTo(TSI2.Name) : TSI1.GroupName.CompareTo(TSI2.GroupName)));
17  }
18  catch { }
19  }
20 
21  public void AddDuration(string Name, TimeSpan Duration)
22  {
23  if (!Contains(Name))
24  {
25  this.Add(new TimeSpanStatisticsItem() {Name=Name});
26  };
27  this[Name].AddDuration(Duration);
28  }
29  }
30 }