Esempio n. 1
0
        private void tsmiSaveAs_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            if (saveFileDialog1.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            // Saving text to file
            if (database == null)
            {
                database = new TrueFalse(saveFileDialog1.FileName);
                database.Add("123", true);
                database.Save();
                nudNumber.Minimum = 1;
                nudNumber.Maximum = 1;
                nudNumber.Value   = 1;
                MessageBox.Show("File saved");
            }
            else
            {
                database.FileName = saveFileDialog1.FileName;
                database.Save();
                MessageBox.Show("File saved");
            }
        }
Esempio n. 2
0
        private void tsmiNew_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                database = new TrueFalse(sfd.FileName);
                database.Add("123", true);
                database.Save();
                nudNumber.Minimum = 1;
                nudNumber.Maximum = 1;
                nudNumber.Value   = 1;
            }
            ;
        }