示例#1
0
        private void miOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Файлы XML (*.xml)|*.xml";
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                database = new TrueFalse(ofd.FileName);
                database.LoadXml();
                nudNumber.Minimum = 1;
                nudNumber.Maximum = database.Count;
                nudNumber.Value   = 1;
            }
        }
示例#2
0
        private void miNew_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "Файлы XML (*.xml)|*.xml";
            if (sfd.ShowDialog() == DialogResult.OK)
            {
                database = new TrueFalse(sfd.FileName);
                database.Add("123", true);
                database.SaveXml();
                nudNumber.Minimum = 1;
                nudNumber.Maximum = 1;
                nudNumber.Value   = 1;
            }
        }
示例#3
0
 private void DatabaseSettings(string filePath)
 {
     database = new TrueFalse(filePath);
     database.onEmptyQuestion    += TurnOffBtns;
     database.onFirstAddQuestion += TurnOnBtns;
 }