示例#1
0
 /// <summary>
 /// 添加 StatistTotalByDateTime,如果存在相同日期的事件,则累加该事件的 Total
 /// </summary>
 /// <param name="statist"></param>
 private void Add(StatistTotalByDateTime statist)
 {
     try {
         this._entries.Add(statist.DateTime, statist);
     }
     catch (ArgumentException) {
         this._entries[statist.DateTime].Total += statist.Total;
     }
 }
示例#2
0
 /// <summary>
 /// 该构造器接收一个字符串序列,把它转换成StatistTotalByDateTime链表,同时接收一个 DateMode 指示日期字符串的分割方式
 /// </summary>
 /// <param name="lines">文本序列</param>
 /// <param name="dateMode">指示日期字符串的分割方式</param>
 public StatistTotalByDateTimeModel(IEnumerable <string> lines, DateMode dateMode)
 {
     foreach (var line in lines)
     {
         if (line != "" && line != "\r")     // 忽略空行
         {
             StatistTotalByDateTime statist = DatetimeParser.ParseExpressToStatistTotalByDateTime(line, dateMode);
             this.Add(statist);
         }
     }
 }
示例#3
0
 /// <summary>
 /// 添加一个条目
 /// </summary>
 /// <param name="statistTotalByDateTime"></param>
 public void AddEntry(StatistTotalByDateTime statistTotalByDateTime)
 {
     this.Add(statistTotalByDateTime);
 }