private void form_Decipher(object sender, EventArgs e)
 {
     if (environmentHelper.DirectoryExists(form.OutputDirectoryPath))
     {
         var dialogResult = messageHelper.Show("Directory already exists. Would you like to overwrite it?",
                                               "Папка уже существует. Вы хотите перезаписать ее?", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.No)
         {
             return;
         }
     }
     try {
         privateKey = keySerializer.DeserializePrivateKey(form.PrivateKey);
     } catch (KeySerializationException) {
         messageHelper.Show("Private key has errors.", "Секретный ключ содержит ошибки.");
         return;
     }
     rsaFileDecipher = rsaFactory.CreateRsaFileDecipher(form.InputFileName);
     rsaFileDecipher.BlockCompleted += decipher_BlockCompleted;
     form.DecipherEnabled            = false;
     RefreshThread();
     thread.Start();
 }
 public void DeserializePrivateKey_LineIsNull()
 {
     Assert.Throws(typeof(ArgumentNullException), () => serializer.DeserializePrivateKey(null));
 }