コード例 #1
0
 private void tsmiSave_Click(object sender, EventArgs e)
 {
     if (database != null)
     {
         database.Save();
     }
     else
     {
         MessageBox.Show("Data base isn't created");
     }
 }
コード例 #2
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");
            }
        }
コード例 #3
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;
            }
            ;
        }