Пример #1
0
 private void btnRandom_Click(object sender, EventArgs e)
 {
     if (CheckChanged())
     {
         currentExcuse = new Excuse(random, selectedFolder);
         UpdateForm(false);
     }
 }
Пример #2
0
 private void btnOpen_Click(object sender, EventArgs e)
 {
     lblFileDate.Text = DateTime.Now.ToString();
     openFileDialog1.InitialDirectory = selectedFolder;
     openFileDialog1.Filter           = "Class Excuse (*.excuse)|*.excuse|All files(*.*)|*.*";
     openFileDialog1.Title            = "Open file";
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         currentExcuse = new Excuse(openFileDialog1.FileName);
         UpdateForm(false);
     }
 }
Пример #3
0
        public void OpenFile(string file)
        {
            this.ExcusePath = file;
            BinaryFormatter binary = new BinaryFormatter();

            using (FileStream input = File.OpenRead(file + @"\Excuse"))
            {
                Excuse newExcuse = (Excuse)binary.Deserialize(input);
                Description = newExcuse.Description;
                Results     = newExcuse.Results;
                LastUsed    = newExcuse.LastUsed;
            }
        }