public static void Read() { var settingFilePath = SettingFilePath(); AppDebug.WriteLine($"Setting file: {settingFilePath}"); if (!File.Exists(settingFilePath)) { AppDebug.WriteLine($"File does not exist"); return; } AppDebug.WriteLine($"File exists"); AppDebug.WriteLine($"--------"); AppDebug.WriteLine(File.ReadAllText(settingFilePath)); AppDebug.WriteLine($"--------"); var sr = new StringReader(File.ReadAllText(settingFilePath)); Data = (PersistedData)Serializer.Deserialize(sr); }
static PersistedState() { Data = new PersistedData(); Serializer = new XmlSerializer(Data.GetType()); Read(); }