Exemple #1
0
        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;
            }
        }
Exemple #2
0
        private void loadQuestions()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                database = new TrueFalse(ofd.FileName);
                database.Load();
                StartGame();
            }
        }
Exemple #3
0
        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;
            }
        }
Exemple #4
0
 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;
     }
 }