예제 #1
0
        private void buttonEncrypt_Click(object sender, EventArgs e)
        {
            this.Enabled = false;
            encryptForm dlg = new encryptForm();

            dlg.ShowDialog();
            this.Enabled = true;
        }
예제 #2
0
        public static void EncryptCallback(object data, int iPct, string sStatus, bool bThreadRun)
        {
            encryptForm form = (encryptForm)data;

            if (invkclosure == true)
            {
                return;
            }



            if (form.InvokeRequired)
            {
                EncryptCallback callback = new Crypt.EncryptCallback(EncryptCallback);
                form.Invoke(callback, data, iPct, sStatus, bThreadRun);
            }
            else
            {
                if (sStatus == "Encryption Failure")
                {
                    form.UpdForm(iPct, sStatus, 2);
                    form.NotifIcnShow("Failed to encrypt " + form.textBoxFile.Text, "Encryption Failure", "error");
                }
                else
                {
                    form.UpdForm(iPct, sStatus, 1);
                    if (iPct == 100 && sStatus == "File Successfully Encrypted")
                    {
                        form.NotifIcnShow(form.textBoxFileDest.Text, "File Successfully Encrypted", "info");
                    }
                }

                form.m_bThreadRun = bThreadRun;
                if (bThreadRun == false)
                {
                    form.UpdUI(true);
                }
            }
        }