From de321a3e39409a0e2264824d3cf6819ee700e3ec Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sun, 20 Sep 2020 00:42:00 -0400 Subject: [PATCH] display a message if we can't find any print handlers to handle the FilePrint command --- Libraries/UniversalEditor.UserInterface/MainWindow.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Libraries/UniversalEditor.UserInterface/MainWindow.cs b/Libraries/UniversalEditor.UserInterface/MainWindow.cs index 6fa7f8e1..caad510b 100644 --- a/Libraries/UniversalEditor.UserInterface/MainWindow.cs +++ b/Libraries/UniversalEditor.UserInterface/MainWindow.cs @@ -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); + } } }