예제 #1
0
        private void buttonOpen_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = workingpath;
            openFileDialog1.Filter           = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            //openFileDialog1.FileName = textBoxExcuse.Text + ".txt";
            DialogResult result        = openFileDialog1.ShowDialog();
            DialogResult MessageResult = System.Windows.Forms.DialogResult.No;

            if (result == DialogResult.OK)
            {
                if (this.formChanged == true)
                {
                    MessageResult = MessageBox.Show("The current excuse has not been saved, Continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                }
                if ((MessageResult == DialogResult.Yes) || (this.formChanged == false))
                {
                    CurrentExcuse = new Excuse(openFileDialog1.FileName);
                    CurrentExcuse.Open(openFileDialog1.FileName);
                    //textBoxExcuse.Text = CurrentExcuse.description;
                    //textBoxResults.Text = CurrentExcuse.results;
                    //dateTimePickerLastUsed.Value = CurrentExcuse.lastused;
                    UpdateForm(false);
                    //
                    //File.OpenRead(openFileDialog1.FileName);
                    //labelTitleofFileDate.Text = File.GetLastAccessTime(saveFileDialog1.FileName).ToString();
                }
            }
        }
예제 #2
0
        private void buttonOpen_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = workingpath;
            openFileDialog1.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            //openFileDialog1.FileName = textBoxExcuse.Text + ".txt";
            DialogResult result = openFileDialog1.ShowDialog();
            DialogResult MessageResult = System.Windows.Forms.DialogResult.No;
            if (result == DialogResult.OK)
            {
                if(this.formChanged == true){

                    MessageResult= MessageBox.Show("The current excuse has not been saved, Continue?","Warning",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
                }
                if((MessageResult == DialogResult.Yes)||(this.formChanged == false)){
                    CurrentExcuse = new Excuse(openFileDialog1.FileName);
                    CurrentExcuse.Open(openFileDialog1.FileName);
                    //textBoxExcuse.Text = CurrentExcuse.description;
                    //textBoxResults.Text = CurrentExcuse.results;
                    //dateTimePickerLastUsed.Value = CurrentExcuse.lastused;
                    UpdateForm(false);
                        //
                        //File.OpenRead(openFileDialog1.FileName);
                    //labelTitleofFileDate.Text = File.GetLastAccessTime(saveFileDialog1.FileName).ToString();
                }

            }
        }
예제 #3
0
 private void randomExcuse_Click(object sender, EventArgs e)
 {
     if (CheckChanged())
     {
         currentExcuse = new Excuse(random, selectedFolder);
         UpdateForm(false);
     }
 }
예제 #4
0
        private void buttonRandom_Click(object sender, EventArgs e)
        {
            DialogResult MessageResult = System.Windows.Forms.DialogResult.No;

            if (this.formChanged == true)
            {
                MessageResult = MessageBox.Show("The current excuse has not been saved, Continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            }
            if ((MessageResult == DialogResult.Yes) || (this.formChanged == false))
            {
                CurrentExcuse = new Excuse(random, workingpath);
                UpdateForm(false);
            }
        }
예제 #5
0
 private void open_Click(object sender, EventArgs e)
 {
     if (CheckChanged())
     {
         openFileDialog1.InitialDirectory = selectedFolder;
         openFileDialog1.Filter           = "Text file (*.txt)|*.txt|All files (*.*)|*.*";
         openFileDialog1.FileName         = description.Text + ".txt";
         DialogResult result = openFileDialog1.ShowDialog();
         if (result == DialogResult.OK)
         {
             currentExcuse = new Excuse(openFileDialog1.FileName);
             UpdateForm(false);
         }
     }
 }
예제 #6
0
        private void buttonRandom_Click(object sender, EventArgs e)
        {
            DialogResult MessageResult = System.Windows.Forms.DialogResult.No;

            if(this.formChanged == true){

                MessageResult= MessageBox.Show("The current excuse has not been saved, Continue?","Warning",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
            }
            if((MessageResult == DialogResult.Yes)||(this.formChanged == false)){
                CurrentExcuse = new Excuse(random, workingpath);
                UpdateForm(false);
            }
        }