Ejemplo n.º 1
0
 /// <summary>
 /// Обработчик пункта меню Save
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void miSave_Click(object sender, EventArgs e)
 {
     if (database != null)
     {
         database.Save();
     }
     else
     {
         MessageBox.Show("База данных не создана");
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Обработчик пункта меню New
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void miNew_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "Файл XML | *.xml";
            if (sfd.ShowDialog() == DialogResult.OK)
            {
                database = new TrueFalse(sfd.FileName);
                database.Add(tboxQuestion.Text, true);
                database.Save();
                nudNumber.Minimum = 1;
                nudNumber.Maximum = 1;
                nudNumber.Value   = 1;
            }
        }