コード例 #1
0
        StartDocument(
            Object o,
            bool documentPrintTicketRequired
            )
        {
            if (documentPrintTicketRequired)
            {
                XpsSerializationPrintTicketRequiredEventArgs e =
                    new XpsSerializationPrintTicketRequiredEventArgs(PrintTicketLevel.FixedDocumentPrintTicket,
                                                                     0);
                OnNGCSerializationPrintTicketRequired(e);
            }

            if (_startDocCnt == 0)
            {
                JobName = PrintQueue.CurrentJobSettings.Description;

                if (JobName == null)
                {
                    JobName = NgcSerializerUtil.InferJobName(o);
                }

                _device = new MetroToGdiConverter(PrintQueue);

                _device.StartDocument(_jobName, _printTicketManager.ConsumeActivePrintTicket(true));
            }
            _startDocCnt++;
        }
コード例 #2
0
        StartDocument(
            Object o,
            bool documentPrintTicketRequired
            )
        {
            if (documentPrintTicketRequired)
            {
                XpsSerializationPrintTicketRequiredEventArgs e =
                    new XpsSerializationPrintTicketRequiredEventArgs(PrintTicketLevel.FixedDocumentPrintTicket,
                                                                     0);
                OnNGCSerializationPrintTicketRequired(e);
            }

            if (_startDocCnt == 0)
            {
                JobName = _printQueue.CurrentJobSettings.Description;

                if (JobName == null)
                {
                    JobName = NgcSerializerUtil.InferJobName(o);
                }

                _device = new MetroToGdiConverter(PrintQueue);

                if (!_isSimulating)
                {
                    (new PrintingPermission(PrintingPermissionLevel.DefaultPrinting)).Assert();

                    try
                    {
                        JobIdentifier = _device.StartDocument(_jobName, _printTicketManager.ConsumeActivePrintTicket(true));
                    }
                    finally
                    {
                        CodeAccessPermission.RevertAssert();
                    }
                }
            }

            _startDocCnt++;
        }