Esempio n. 1
0
        /// <summary>
        /// Selected index change for cryptography.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cboOperation_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Get the selected combo box index.
            switch (cboOperation.SelectedIndex)
            {
            case 0:
                // No operation specified.
                _cryto = CryptographyType.None;
                lblEncryptLocalFile.Text = "Encrypted File";
                lblDecryptLocalFile.Text = "Decrypted File";
                break;

            case 1:
                // Encrypt operation specified.
                _cryto = CryptographyType.Encrypt;
                lblEncryptLocalFile.Text = "Encrypted File";
                lblDecryptLocalFile.Text = "File To Encrypt";
                break;

            case 2:
                // Decrypt operation specified.
                _cryto = CryptographyType.Decrypt;
                lblEncryptLocalFile.Text = "File To Decrypt";
                lblDecryptLocalFile.Text = "Decrypted File";
                break;
            }

            // Get the selected combo box index.
            switch (cboOperation.SelectedIndex)
            {
            case 0:
                // Disable the execute control button.
                btnCryptExecute.Enabled     = false;
                btnEncryptLocalFile.Enabled = false;
                btnDecryptLocalFile.Enabled = false;
                btnCertificatePath.Enabled  = false;
                break;

            default:
                // Enable the execute control button.
                btnCryptExecute.Enabled     = true;
                btnEncryptLocalFile.Enabled = true;
                btnDecryptLocalFile.Enabled = true;
                btnCertificatePath.Enabled  = true;
                break;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Возвращает текущий тип криптографии
 /// </summary>
 /// <param name="pcName">
 /// Имя машины в локальной сети ПВП
 /// </param>
 /// <returns>
 /// Теущий тип криптографии
 /// </returns>
 public long GetCurrentCryptographyType(string pcName, ref CryptographyType type)
 {
     type = (CryptographyType)Service.GetCurrentCryptographyType(pcName);
     return(0);
 }