Ejemplo n.º 1
0
        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
            {
            }
        }
Ejemplo n.º 2
0
        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();
                }
            }
        }
Ejemplo n.º 3
0
		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 ();
				}
			}
		}