Beispiel #1
0
 private static void TrySaveAndResetAll(string currentDate)
 {
     if (string.IsNullOrEmpty(_lastDate))
     {
         _lastDate = currentDate;
         return;
     }
     //如果天数发生变化 则需要保存
     if (!string.Equals(_lastDate, currentDate))
     {
         var keys = TypeKeys.ToArray();
         foreach (var typeKey in keys)
         {
             var newsummary = new ExecuteSummary
             {
                 TypeKey = typeKey,
                 Load    = 0
             };
             SaveSummary(newsummary, currentDate);
             _lastDate = currentDate;
         }
     }
 }
Beispiel #2
0
        private static void SaveSummary(ExecuteSummary summary, string date)
        {
            var summaryFullName = GetSummaryFileName(summary.TypeKey, date);

            File.WriteAllText(summaryFullName, SerializationUtils.XmlSerialize(summary));
        }