private void tsmiOpen_Click(object sender, EventArgs e) { //Открытие существующего файла БД if (changeBase) { DialogResult result = MessageBox.Show("Сохранить изменения?", "Сохранение", MessageBoxButtons.YesNoCancel); if (result == DialogResult.Yes) { tsmiSave.PerformClick(); } else if (result == DialogResult.Cancel) { return; } } OpenFileDialog openFile = new OpenFileDialog(); openFile.Filter = "XML Files|*.xml"; if (openFile.ShowDialog() == DialogResult.OK) { database = new TrueFalse(openFile.FileName); database.Load(); Binding(); tabPage1.Text = Path.GetFileName(openFile.FileName); newFile = false; changeBase = false; fileOpen = true; } }
private void loadQuestions() { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { database = new TrueFalse(ofd.FileName); database.Load(); StartGame(); } }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { database = new TrueFalse(ofd.FileName); database.Load(); numericUpDownNumber.Minimum = 1; numericUpDownNumber.Maximum = database.Count; numericUpDownNumber.Value = 1; } }
private void fBelieve_Load(object sender, EventArgs e) { //Загрузить последний открытый файл if (Properties.Settings.Default.LastPath != string.Empty) { database = new TrueFalse(Properties.Settings.Default.LastPath); database.Load(); Binding(); tabPage1.Text = Path.GetFileName(Properties.Settings.Default.LastPath); newFile = false; changeBase = false; fileOpen = true; } }
private void newToolStripMenuItem_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(); numericUpDownNumber.Minimum = 1; numericUpDownNumber.Maximum = 1; numericUpDownNumber.Value = 1; } ; }
private void tsmiNew_Click(object sender, EventArgs e) { //Создание новый базы данных if (changeBase) { DialogResult result = MessageBox.Show("Сохранить изменения?", "Сохранение", MessageBoxButtons.YesNoCancel); if (result == DialogResult.Yes) { tsmiSave.PerformClick(); } else if (result == DialogResult.Cancel) { return; } } database = new TrueFalse(string.Empty); Binding(); tbText.Text = string.Empty; cbTrueFalse.Checked = false; tabPage1.Text = "Новая БД*"; newFile = true; changeBase = true; fileOpen = true; }