private void KeyFileNoButton_Click(object sender, EventArgs e)
        {
            MasterForm frm = new MasterForm();

            frm.Show();
            frm.PerformRefresh();
            this.Close();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            FileOP.SelectKeyFile();
            Crypto.EncryptFile(FileOP.GetFile(), FileOP.KeyFileToBits(FileOP.GetKeyFile()));
            FileOP.ClearKeyFile();
            MasterForm frm = new MasterForm();

            frm.Show();
            frm.PerformRefresh();
            this.Close();
        }
예제 #3
0
 private void Confirm_Click(object sender, EventArgs e)
 {
     if (KeyfileLocation.TextLength > 0)
     {
         if (!Crypto.DecryptFile(FileOP.GetFile(), FileOP.KeyFileToBits(KeyfileLocation.Text)))
         {
             MessageBox.Show("Inncorrect Credentials. Please Try Again.", "Access Denied", MessageBoxButtons.OK);
             KeyfileLocation.ResetText();
         }
         else if (!Crypto.DecryptFile(FileOP.GetFile(), passwordEntry.Text))
         {
             Crypto.EncryptFile(FileOP.GetFile(), FileOP.KeyFileToBits(KeyfileLocation.Text));
             MessageBox.Show("Inncorrect Credentials. Please Try Again.", "Access Denied", MessageBoxButtons.OK);
             KeyfileLocation.ResetText();
         }
         else
         {
             FileOP.LoadKeyFile(KeyfileLocation.Text);
             Crypto.mPassTemp = passwordEntry.Text;
             Compressor.Decompress(FileOP.GetFile());
             TheParent.PerformRefresh(true);
             success = true;
             this.Close();
         }
     }
     else if (!Crypto.DecryptFile(FileOP.GetFile(), passwordEntry.Text))
     {
         MessageBox.Show("Inncorrect Credentials. Please Try Again.", "Access Denied", MessageBoxButtons.OK);
         KeyfileLocation.ResetText();
     }
     else
     {
         Crypto.mPassTemp = passwordEntry.Text;
         Compressor.Decompress(FileOP.GetFile());
         TheParent.PerformRefresh(true);
         success = true;
         this.Close();
     }
 }
예제 #4
0
        /// <summary>
        /// Creates the master password print pop-up.
        /// </summary>
        private void CreatePrintPopUp()
        {
            MasterPasswordPrintPopUp printPopUp;

            if (passwordOptionsDarkThemeEnabled)
            {
                printPopUp = new MasterPasswordPrintPopUp(PassEntry1.Text, Color.White, Color.DarkGray, Color.DarkSlateGray, passwordOptionsDarkThemeEnabled);
            }
            else
            {
                printPopUp = new MasterPasswordPrintPopUp(PassEntry1.Text, SystemColors.ControlText, SystemColors.Window, SystemColors.Control, passwordOptionsDarkThemeEnabled);
            }

            // Adding all the printPopUp components to the list of components in the master from.
            // This is done to apply the same theme and text size to all of the forms
            MasterForm controlForm = new MasterForm();

            controlForm.labels.AddRange(printPopUp.printPopUpLabels);
            controlForm.buttons.AddRange(printPopUp.printPopUpButtons);
            controlForm.forms.Add(printPopUp);

            // Changing text size of printPopUp
            if (passwordOptionsDefaultTextSizeEnabled)
            {
                controlForm.ChangeFontSize(8.0f);
                printPopUp.printPopUpDefaultTextSizeEnabled = true;
                printPopUp.printPopUpSmallTextSizeEnabled   = false;
                printPopUp.printPopUpLargeTextSizeEnabled   = false;
            }

            else if (passwordOptionsSmallTextSizeEnabled)
            {
                controlForm.ChangeFontSize(6.0f);
                printPopUp.printPopUpDefaultTextSizeEnabled = false;
                printPopUp.printPopUpSmallTextSizeEnabled   = true;
                printPopUp.printPopUpLargeTextSizeEnabled   = false;
            }

            else if (passwordOptionsLargeTextSizeEnabled)
            {
                controlForm.ChangeFontSize(10.0f);
                printPopUp.printPopUpDefaultTextSizeEnabled = false;
                printPopUp.printPopUpSmallTextSizeEnabled   = false;
                printPopUp.printPopUpLargeTextSizeEnabled   = true;
            }

            printPopUp.ShowDialog();
            TheParent.PerformRefresh(true);
            success = true;
            this.Close();
        }