Exemple #1
0
        private void Create_Temp_Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                SaveDataJson _data = new SaveDataJson(true);

                _data.AddNewEntry("Arrow", 5, 9);
                _data.AddNewEntry("Flash", 3, 5);
                _data.AddNewEntry("The 100", 3);

                SaveFileDialog _dialog = new SaveFileDialog
                {
                    Filter           = MyConsts.JsonFilter,
                    InitialDirectory = $"{RootPath}\\{RootFolderName}",
                };

                if (_dialog.ShowDialog() == true)
                {
                    File.WriteAllText(_dialog.FileName, JsonConvert.SerializeObject(_data, Formatting.Indented));
                }
            }
            catch (Exception EX)
            {
                MessageBox.Show(EX.Message);
            }
        }
Exemple #2
0
 private void New_Entry_Button_Click(object sender, RoutedEventArgs e)
 {
     m_data.AddNewEntry("New Title", 1, 1, "Empty Note");
     UpdateUI();
 }