示例#1
0
        public static T Load <T>(string path)
        {
            if (!File.Exists(path))
            {
                throw new FileNotFoundException($"File '{path}' not found", path);
            }

            var inputXml = File.ReadAllText(path);

            return(HelperXmlSerializer.Deserialize <T>(inputXml));
        }
示例#2
0
 public static T LoadFromXml <T>(string xml)
 {
     return(HelperXmlSerializer.Deserialize <T>(xml));
 }