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