Example #1
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);
         }
     }
 }
Example #2
0
 /// <summary>
 /// 添加一个条目
 /// </summary>
 /// <param name="rectName">接收一个字符串表达式,格式为“mm dd yyyy x{Total}”或“mm/dd/yyyy”</param>
 public void AddEntry(string rectName)
 {
     this.AddEntry(DatetimeParser.ParseExpressToStatistTotalByDateTime(rectName, DateMode.DateWithSlash));
 }