Пример #1
0
        //Try to create new item, returns null if unsuccesful, sets Setting.DiaryDirectory
        private Diary tryCreateNewDiary()
        {
            Diary  newDiary  = new Diary();
            string directory = "";

            DiarySettings fds = new DiarySettings(newDiary);

            fds.ShowDialog();
            if (fds.DialogResult == DialogResult.OK)
            {
                if (saveDialogDiary.ShowDialog() == DialogResult.OK)
                {
                    directory          = saveDialogDiary.FileName;
                    newDiary.Directory = directory;
                }
            }

            try
            {
                newDiary = Diary.Load(directory);
            }
            catch
            {
                return(null);
            }

            Settings.Settings.SettingsHolder.DiaryDirectory = directory;
            return(newDiary);
        }
Пример #2
0
        private void nastaveníDeníkuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DiarySettings ds = new DiarySettings(m_mainDiary);

            ds.ShowDialog(this);

            m_mainDiary.UpdateRecords();
            m_mainDiary.StoreChanges();
            UpdateCurrentPage();
        }