protected override bool RunDialog(IntPtr hwndOwner) { var currentDirectory = Environment.CurrentDirectory; try { using (var context = new ModalDialogContext()) { using (var panel = new NSPrintPanel()) { var info = NSPrintInfo.SharedPrintInfo ?? new NSPrintInfo(); if (NSPanelButtonType.Ok != (NSPanelButtonType)(int)panel.RunModalWithPrintInfo(info)) { return(false); } } return(true); } } finally { } }
void ShowDocument(NSObject sender) { var dlg = new NSPrintPanel(); // Display the print dialog as dialog box if (ShowPrintAsSheet) { dlg.BeginSheet(new NSPrintInfo(), this, this, null, new IntPtr()); } else { if (dlg.RunModalWithPrintInfo(new NSPrintInfo()) == 1) { var alert = new NSAlert() { AlertStyle = NSAlertStyle.Warning, InformativeText = "We need to print the document here...", MessageText = "Print Document", }; alert.RunModal(); } } }
void ShowDocument (NSObject sender) { var dlg = new NSPrintPanel(); // Display the print dialog as dialog box if (ShowPrintAsSheet) { dlg.BeginSheet(new NSPrintInfo(),this,this,null,new IntPtr()); } else { if (dlg.RunModalWithPrintInfo(new NSPrintInfo()) == 1) { var alert = new NSAlert () { AlertStyle = NSAlertStyle.Warning, InformativeText = "We need to print the document here...", MessageText = "Print Document", }; alert.RunModal (); } } }