private void BtnX_Click(object sender, EventArgs e)
 {
     FilesHelper.SerializeListToJsonFile(ListOfChildren, FilesHelper.FilePathToAppDataFolder(FilesNames.childJson));
     FilesHelper.SerializeListToJsonFile(ListOfEnjoymentCategories, FilesHelper.FilePathToAppDataFolder(FilesNames.enjoymentsCategoriesJson));
     FilesHelper.SerializeListToJsonFile(ListOfEnjoyments, FilesHelper.FilePathToAppDataFolder(FilesNames.enjoymentsJson));
     Environment.Exit(0);
 }
        public MyDearChildMainForm()
        {
            InitializeComponent();
            ListOfChildren            = FilesHelper.DeserializeJsonFileToList(ListOfChildren, FilesHelper.FilePathToAppDataFolder(FilesNames.childJson));
            ListOfEnjoymentCategories = FilesHelper.DeserializeJsonFileToList(ListOfEnjoymentCategories, FilesHelper.FilePathToAppDataFolder(FilesNames.enjoymentsCategoriesJson));
            ListOfEnjoyments          = FilesHelper.DeserializeJsonFileToList(ListOfEnjoyments, FilesHelper.FilePathToAppDataFolder(FilesNames.enjoymentsJson));

            if (ListOfEnjoymentCategories.Count == 0)
            {
                ListOfEnjoymentCategories.Add("Vtipný");
                ListOfEnjoymentCategories.Add("Sny");
                ListOfEnjoymentCategories.Add("Pohyb");
            }
        }
 private void MyDearChildMainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     FilesHelper.SerializeListToJsonFile(ListOfChildren, FilesHelper.FilePathToAppDataFolder(FilesNames.childJson));
     FilesHelper.SerializeListToJsonFile(ListOfEnjoymentCategories, FilesHelper.FilePathToAppDataFolder(FilesNames.enjoymentsCategoriesJson));
     FilesHelper.SerializeListToJsonFile(ListOfEnjoyments, FilesHelper.FilePathToAppDataFolder(FilesNames.enjoymentsJson));
 }