Exemplo n.º 1
0
 /// <summary>
 /// 将文件列表反序列化成对象集合
 /// </summary>
 public static IEnumerable <T> Load <T>(params String[] files) where T : class
 {
     foreach (String file in files)
     {
         if (!File.Exists(file))
         {
             break;
         }
         T schema = null;
         try
         {
             schema = TKXmlSerializer.DeSerialize <T>(file);
         }
         catch
         {
             throw new Exception(file);
         }
         if (schema != null)
         {
             yield return(schema);
         }
     }
 }
 /// <summary>
 /// 从指定路径加载数据提取模板
 /// </summary>
 public static ExcelDataExtractTemplate Load(String filePath)
 {
     return(TKXmlSerializer.DeSerialize <ExcelDataExtractTemplate>(filePath));
 }