display a message if we can't find any print handlers to handle the FilePrint command

This commit is contained in:
Michael Becker 2020-09-20 00:42:00 -04:00
parent a2f874a728
commit de321a3e39
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -1190,7 +1190,8 @@ namespace UniversalEditor.UserInterface
public void PrintDocument()
{
Editor editor = GetCurrentEditor ();
if (editor != null) {
if (editor != null)
{
PrintHandlerReference[] phrs = UniversalEditor.Printing.Reflection.GetAvailablePrintHandlers(editor.ObjectModel);
if (phrs.Length > 0)
{
@ -1210,6 +1211,10 @@ namespace UniversalEditor.UserInterface
}
}
}
else
{
MessageDialog.ShowDialog(String.Format("No print handlers are associated with the ObjectModel.\r\n\r\n{0}", editor.ObjectModel?.GetType()?.FullName ?? "(null)"), "Print Document", MessageDialogButtons.OK, MessageDialogIcon.Error);
}
}
}