Example #1
0
        private void LoadUserData()
        {
            var fn = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), $"{Id}_ud.json");

            if (File.Exists(fn))
            {
                UserData = LeseplanUserData.Load(File.ReadAllText(fn));
            }
            else
            {
                UserData = new LeseplanUserData();
                SaveUserData();
            }
        }
Example #2
0
        private void ItemVMCheckedChanged(ItemVM item, bool chked)
        {
            if (UserData == null)
            {
                UserData = new LeseplanUserData();
            }
            var key = item.Ref;

            if (!UserData.ReadItems.ContainsKey(key))
            {
                UserData.ReadItems[key] = new ItemReadData {
                    Ref = item.Ref
                };
            }
            UserData.ReadItems[key].Checked = chked;
            SaveUserData();
        }