예제 #1
0
        private static ExecuteSummary ReadSummary(string typeKey, string date)
        {
            var summaryFullName = GetSummaryFileName(typeKey, date);

            if (File.Exists(summaryFullName))
            {
                return(SerializationUtils.XmlDeserializeFromFile <ExecuteSummary>(summaryFullName));
            }
            return(new ExecuteSummary
            {
                TypeKey = typeKey
            });
        }
예제 #2
0
 private T ReadConfig <T>(string path)
 {
     try
     {
         return(SerializationUtils.XmlDeserializeFromFile <T>(path));
     }
     catch (Exception)
     {
         T newCreate = default(T);
         WriteConfig(PathUtils.ClientConfigPath, newCreate);
         return(newCreate);
     }
 }
예제 #3
0
        /// <summary>
        /// </summary>
        /// <param name="typeKey"></param>
        /// <param name="record"></param>
        internal static bool TryReadRecord(string typeKey, out ExecuteRecord record)
        {
            record = null;
            var fileName = GetRecordFileName(typeKey);

            try
            {
                if (File.Exists(fileName))
                {
                    record = SerializationUtils.XmlDeserializeFromFile <ExecuteRecord>(fileName);
                    return(true);
                }
            }
            catch (Exception ex)
            {
                ExceptionLog(string.Format("TryReadRecord PluginExecuteRecord {0}", typeKey), ex);
            }
            //如果没有找到执行记录
            //则将创建执行记录设置为当前时间
            ForceCreateRecord(typeKey);
            return(false);
        }