wpf-devexpress-dot-xpf-dot-richedit-dot-richeditcontrol-28fc7837.md
Occurs if the RichEditControl failed to open an encrypted file.
Namespace : DevExpress.Xpf.RichEdit
Assembly : DevExpress.Xpf.RichEdit.v25.2.dll
NuGet Package : DevExpress.Wpf.RichEdit
public event DecryptionFailedEventHandler DecryptionFailed
Public Event DecryptionFailed As DecryptionFailedEventHandler
The DecryptionFailed event's data class is DecryptionFailedEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Exception | Returns an exception that led to the event. |
he DecryptionFailed event is raised when the RichEditControl cannot decrypt a loaded file. Check the Exception property to determine the exception that led to this event.
The event also occurs if the EncryptedFilePasswordCheckFailedEventArgs.TryAgain property is not specified or set to false.
If the event is not handled, the RichEditControl does not load an empty file.
The code sample below shows how to handle the DecryptionFailed event to show an exception message.
private void RichEditControl1_DecryptionFailed(object sender, DecryptionFailedEventArgs e)
{
System.Windows.Forms.MessageBox.Show(e.Exception.Message.ToString());
}
Private Sub RichEditControl1_DecryptionFailed(ByVal sender As Object, ByVal e As DecryptionFailedEventArgs)
System.Windows.Forms.MessageBox.Show(e.Exception.Message.ToString())
End Sub
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DecryptionFailed event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-richedit-document-encryption/CS/DXRichEdit_Encryption/MainWindow.xaml#L43
EncryptedFilePasswordCheckFailed="RichEditControl1_EncryptedFilePasswordCheckFailed"
DecryptionFailed="RichEditControl1_DecryptionFailed">
</dxre:RichEditControl>
See Also