示例#1
0
        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);
        }
示例#2
0
 static PersistedState()
 {
     Data       = new PersistedData();
     Serializer = new XmlSerializer(Data.GetType());
     Read();
 }