Esempio n. 1
0
        private void frm_settings_FormClosed(object sender, FormClosedEventArgs e)
        {
            // Set output names to default if left blank
            if (txt_imgOutput.Text == "")
            {
                txt_imgOutput.Text = "encrypted";
            }
            if (txt_msgOutput.Text == "")
            {
                txt_msgOutput.Text = "message";
            }

            // Save settings
            Properties.Settings.Default.encImgDefault      = txt_encImg.Text;
            Properties.Settings.Default.encMsgDefault      = txt_encMsg.Text;
            Properties.Settings.Default.decImgDefault      = txt_decImg.Text;
            Properties.Settings.Default.encImgOutputFormat = SetOutputFormat(gb_imgOutput);
            Properties.Settings.Default.decMsgOutputFormat = SetOutputFormat(gb_msgOutput);
            Properties.Settings.Default.encImgOutputName   = txt_imgOutput.Text;
            Properties.Settings.Default.decMsgOutputName   = txt_msgOutput.Text;
            Properties.Settings.Default.Save();

            // Show main form if back button was pressed, otherwise close application
            if (!backPressed)
            {
                mainForm.Close();
            }
            else
            {
                MiscUtils.SetNewFormLocation(this, mainForm);
                this.mainForm.Show();
            }
        }
Esempio n. 2
0
 private void frm_encrypt_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (!backPressed)
     {
         mainForm.Close();
     }
     else
     {
         Point formLoc = new Point((this.Width + this.Location.X) / 2, this.Location.Y);
         this.mainForm.Location = formLoc;
         this.mainForm.Show();
     }
 }