示例#1
0
文件: XML.cs 项目: koufengwei/Brake
 public static Container getContainer()
 {
     if (container == null) {
         try {
             XmlSerializer serializer = new XmlSerializer (typeof(Container));
             StreamReader reader = new StreamReader ("Brake.xml");
             container = (Container)serializer.Deserialize (reader);
             reader.Close ();
         } catch (System.IO.FileNotFoundException) {
             Console.WriteLine ("==============================");
             Console.WriteLine ("Looks like you're new, please fill in the details of your device");
             container = new Container ();
         }
     }
     return container;
 }