Beispiel #1
0
        private void ButtonEncryptClick(object sender, EventArgs e)
        {
            toolStripProgressEnctypt.Visible = true;
            toolStripStatusLabel.Visible     = false;

            Task.Run(() =>
            {
                var button      = (ToolStripMenuItem)sender;
                var processType = (EncryptionEnum)button.Tag;
                EncodDecodEventArgs arg;
                switch (currentCoder)
                {
                case Coder.PolybiusCoder:
                case Coder.VizhinerCoder:
                case Coder.PairedСipherCoder:
                    arg = new EncodDecodEventArgs(processType, currentCoder, activeTxtBox.Text, key);
                    break;

                default:
                    arg = new EncodDecodEventArgs(processType, Coder.CaesarCoder, activeTxtBox.Text, key1, key2);
                    break;
                }
                OnEncodDecodClick(arg);
            });
        }
Beispiel #2
0
        private void ViewButtonClick(object sender, EncodDecodEventArgs e)
        {
            IEncryption coder;

            switch (e.CoderType)
            {
            case Coder.PolybiusCoder:
                coder = securityManager.PolybiusCoder(e.Key);
                break;

            case Coder.VizhinerCoder:
                coder = securityManager.VizhinerCoder(e.Key);
                break;

            case Coder.PairedСipherCoder:
                coder = securityManager.PairedСipher(e.Key);
                break;

            default:
                coder = securityManager.CeasarCoder(e.KeyOne, e.KeyTwo);
                break;
            }

            Task.Run(() =>
            {
                ProcessText(e.ProcessType, coder, e.Text);
            });
        }
Beispiel #3
0
 protected void OnEncodDecodClick(EncodDecodEventArgs e)
 {
     EncodDecodClick(this, e);
 }