Example #1
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                DB = new TrueFalse(sfd.FileName);
                DB.Add("Empty Quest", true);
                DB.Save();
                NumCounter.Minimum = 1;
                NumCounter.Maximum = 1;
                NumCounter.Value   = 1;
            }
            ;
        }
Example #2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                double size = new FileInfo(ofd.FileName).Length;
                if ((size / 1024) > 10)
                {
                    MessageBox.Show("Too Large");                     //открытие слишком большого файла
                }
                else
                {
                    DB = new TrueFalse(ofd.FileName);
                    DB.Load();
                    NumCounter.Minimum = 1;
                    NumCounter.Maximum = DB.Count;
                    NumCounter.Value   = 1;
                }
            }
        }