Exemple #1
0
 public static Task <MallKioskDemoSettings> FromContentAsync(string content)
 {
     return(Task.Run <MallKioskDemoSettings>(() =>
     {
         using (TextReader reader = new StringReader(content))
         {
             var xs = new XmlSerializer(typeof(MallKioskDemoSettings));
             MallKioskDemoSettings result = (MallKioskDemoSettings)xs.Deserialize(reader);
             return result;
         }
     }));
 }
Exemple #2
0
 public static Task <MallKioskDemoSettings> FromFileAsync(string filePath)
 {
     return(Task.Run <MallKioskDemoSettings>(() =>
     {
         using (FileStream fileStream = File.OpenRead(filePath))
         {
             var xs = new XmlSerializer(typeof(MallKioskDemoSettings));
             MallKioskDemoSettings result = (MallKioskDemoSettings)xs.Deserialize(fileStream);
             return result;
         }
     }));
 }