Exemplo n.º 1
0
 PrintDlgExMarshaler(
     IntPtr owner,
     Win32PrintDialog dialog
     )
 {
     _ownerHandle         = owner;
     _dialog              = dialog;
     _unmanagedPrintDlgEx = IntPtr.Zero;
 }
Exemplo n.º 2
0
 PrintDlgExMarshaler(
     IntPtr owner, 
     Win32PrintDialog dialog 
     )
 { 
     _ownerHandle = owner;
     _dialog = dialog;
     _unmanagedPrintDlgEx = IntPtr.Zero;
 } 
Exemplo n.º 3
0
        ShowDialog()
        {
            //
            // Reset this flag as we have not displayed the dialog yet.
            //
            _dialogInvoked = false;

            Win32PrintDialog dlg = new Win32PrintDialog();

            //
            // Setup the old values if any exist.
            //
            dlg.PrintTicket = _printTicket;
            dlg.PrintQueue = _printQueue;
            dlg.MinPage = Math.Max(1, Math.Min(_minPage, _maxPage));
            dlg.MaxPage = Math.Max(dlg.MinPage, Math.Max(_minPage, _maxPage));
            dlg.PageRangeEnabled = _userPageRangeEnabled;
            dlg.SelectedPagesEnabled = _selectedPagesEnabled;
            dlg.CurrentPageEnabled = _currentPageEnabled;

            dlg.PageRange = new PageRange(
                Math.Max((int)dlg.MinPage, _pageRange.PageFrom),
                Math.Min((int)dlg.MaxPage, _pageRange.PageTo));
            dlg.PageRangeSelection = _pageRangeSelection;

            //
            // Invoke the Win32 dialog
            //
            UInt32 dialogResult = dlg.ShowDialog();

            if ((dialogResult == MS.Internal.Printing.NativeMethods.PD_RESULT_APPLY) ||
                (dialogResult == MS.Internal.Printing.NativeMethods.PD_RESULT_PRINT))
            {
                _printTicket = dlg.PrintTicket;
                _printQueue = dlg.PrintQueue;
                _pageRange = dlg.PageRange;
                _pageRangeSelection = dlg.PageRangeSelection;
                _dialogInvoked = true;
            }

            return (dialogResult == MS.Internal.Printing.NativeMethods.PD_RESULT_PRINT);
        }
Exemplo n.º 4
0
 internal PrintDlgExMarshaler(IntPtr owner, Win32PrintDialog dialog)
 {
     this._ownerHandle         = owner;
     this._dialog              = dialog;
     this._unmanagedPrintDlgEx = IntPtr.Zero;
 }