示例#1
0
        public void Delete(int Id)
        {
            var All = GetAll().ToList();

            All.RemoveAll(x => x.Id.Equals(Id));

            Manager.ClearFile();
            foreach (var item in All)
            {
                Manager.Serialize(item);
            }
        }
示例#2
0
        private static int CheckSettings()
        {
            var      Manager = new ToFolder(Path + @"\\Settings.json");
            Settings SettingsData;

            try
            {
                SettingsData = Manager.Deserialize <Settings>()[0];
            }
            catch (System.Exception)
            {
                SettingsData = new Settings
                {
                    NumberOfRealisation = 1
                };

                Manager.ClearFile();
                Manager.Serialize(SettingsData);
            }

            return(SettingsData.NumberOfRealisation);
        }