private void DoWork() { if (string.IsNullOrEmpty(Input) ^ string.IsNullOrEmpty(Id)) { if (!string.IsNullOrEmpty(Id)) { Result = Alias.RecoverSecret(Id); } else { Result = Alias.DecryptText(Input); } } else { throw new X509CryptoException("Either the \"-Secret\" or the \"-Expression\" must be defined, but not both."); } }