• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Printing.PrintEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Drawing.Printing.PrintEventArgs的典型用法代码示例。如果您正苦于以下问题:C# PrintEventArgs类的具体用法?C# PrintEventArgs怎么用?C# PrintEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PrintEventArgs类属于System.Drawing.Printing命名空间,在下文中一共展示了PrintEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnBeginPrint

        protected override void OnBeginPrint(PrintEventArgs e) {
            base.OnBeginPrint(e);

            m_iTextLength = m_oScintillaControl.TextLength;
            m_iLastPrintPosition = 0;
            m_iCurrentPrintPage = 1;
        }
开发者ID:zcnet4,项目名称:lua-tilde,代码行数:7,代码来源:PrintDocument.cs


示例2: OnStartPrint

        public override void OnStartPrint(PrintDocument document, PrintEventArgs e) {
            Debug.Assert(dc == null && graphics == null, "PrintController methods called in the wrong order?");

            // For security purposes, don't assume our public methods methods are called in any particular order
            CheckSecurity();

            base.OnStartPrint(document, e);

            
            try {
                
                if (!document.PrinterSettings.IsValid)
                throw new InvalidPrinterException(document.PrinterSettings);

                IntSecurity.AllPrintingAndUnmanagedCode.Assert();
                
                // We need a DC as a reference; we don't actually draw on it.
                // We make sure to reuse the same one to improve performance.
                dc = document.PrinterSettings.CreateInformationContext(modeHandle);
            }
            finally {
                CodeAccessPermission.RevertAssert();
            }
            
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:25,代码来源:PreviewPrintController.cs


示例3: OnBeginPrint

        /// <summary>
        /// BeginPrint event handler
        /// </summary>
        /// <param name="e">PrintEventArgs object</param>
        protected override void OnBeginPrint(PrintEventArgs e)
        {
            base.OnBeginPrint(e);
            cardsPrinted = 0;
            dispQsos = qsos.GetDispQsosList(QslCard);
            if(PrinterSettings == null || QslCard == null)
            {
                App.Logger.Log("Programming error: Attempting to print cards before " +
                               "CardPrintDocument.PrintProperties or CardPrintDocument" +
                               ".QslCard is initialized.");
                MessageBox.Show("Programming Error: Please log a bug report and include " +
                                "the contents of the log file", "Programming Error",
                                MessageBoxButton.OK, MessageBoxImage.Error);
                e.Cancel = true;
                return;
            }
            this.DocumentName = "Qsl Cards";
            PrinterSettings settings = new PrinterSettings();
            settings.PrinterName = PrintProperties.PrinterName;
            settings.DefaultPageSettings.PaperSize = PrintProperties.PrinterPaperSize;
            settings.DefaultPageSettings.PrinterResolution = PrintProperties.Resolution;
            settings.DefaultPageSettings.PaperSource = PrintProperties.Source;
            if(PrintProperties.Layout == PrintProperties.CardLayouts.LandscapeTopLeft ||
               PrintProperties.Layout == PrintProperties.CardLayouts.LandscapeTopCenter ||
               PrintProperties.Layout == PrintProperties.CardLayouts.LandscapeCenter)
            {
                settings.DefaultPageSettings.Landscape = true;
            }
            this.PrinterSettings = settings;

            CalculateCardsPerPage();
            CalculateOffsets();
        }
开发者ID:jimva3hj,项目名称:hamqsler,代码行数:37,代码来源:CardPrintDocument.cs


示例4: OnEndPrint

 protected virtual void OnEndPrint(PrintEventArgs e)
 {
     if (this.endPrintHandler != null)
     {
         this.endPrintHandler(this, e);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:PrintDocument.cs


示例5: OnBeginPrint

 protected override void OnBeginPrint(PrintEventArgs ev)
 {
     base.OnBeginPrint(ev);
       if (this.fntPrintFont != null)
     return;
       this.fntPrintFont = new Font("Times New Roman", 12f);
 }
开发者ID:HankTheDrunk,项目名称:ultimaonlinemapcreator,代码行数:7,代码来源:TextPrint.cs


示例6: OnBeginPrint

                protected override void OnBeginPrint(PrintEventArgs e)
                {
                        this.DocumentName = Sheet.Name.Replace(":", "");
                        this.PageNumber = 0;

                        base.OnBeginPrint(e);
                }
开发者ID:solutema,项目名称:ultralight,代码行数:7,代码来源:ImpresorListado.cs


示例7: OnEndPrint

        public override void OnEndPrint(PrintDocument document, PrintEventArgs e)
        {
            base.OnEndPrint(document, e);
            document.PrinterSettings.PrintToFile = _isPrintToFile;

            if (ShowAfterPrint)
                System.Diagnostics.Process.Start(this.FileName);

            Document doc = new Document();
            doc.DateCreated = File.GetLastWriteTime(this.FileName);
            if (_sit == PrintSituation.Claim)
            {
                doc.DocCategory = DefC.GetByExactName(DefCat.ImageCats, "EClaims");
                if (doc.DocCategory == 0)
                {
                    Def d = new Def() { Category = DefCat.ImageCats, ItemName = "EClaims" };
                    doc.DocCategory = Defs.Insert(d);
                    DataValid.SetInvalid(InvalidType.Defs);
                }
            }
            else
            {
                doc.DocCategory = DefC.GetList(DefCat.ImageCats)[0].DefNum;//First category.
            }
            doc.FileName = Path.GetFileName(this.FileName);
            doc.Description = doc.FileName;
            doc.PatNum = _patient.PatNum;
            Documents.Insert(doc);
        }
开发者ID:mnisl,项目名称:OD,代码行数:29,代码来源:Printing.cs


示例8: OnBeginPrint

        protected override void OnBeginPrint(PrintEventArgs e)
        {
            base.OnBeginPrint(e);

            if (m_InkFriendlyMode)
            {
                m_HeaderTextBrush = new SolidBrush(Color.Black);
                m_HeaderBackgroundBrush = new SolidBrush(Color.White);

                m_BorderPen = new Pen(Color.DarkGray, 3);
                m_BackgroundBrush = new SolidBrush(Color.White);

                m_WorkoutDetailsBrush = new SolidBrush(Color.Black);
            }
            else
            {
                m_HeaderTextBrush = new SolidBrush(Color.White);
                m_HeaderBackgroundBrush = new SolidBrush(Color.Black);

                m_BorderPen = new Pen(Color.Black, 3);
                m_BackgroundBrush = new SolidBrush(Color.LightGray);

                m_WorkoutDetailsBrush = new SolidBrush(Color.Black);
            }

            m_HeaderFont = new Font(FontFamily.GenericSansSerif, 16, FontStyle.Bold);
            m_HeaderNotesFont = new Font(FontFamily.GenericSansSerif, 10);
            m_WorkoutDetailsFont = new Font(FontFamily.GenericSansSerif, 10);
            m_StepHeaderFont = new Font(FontFamily.GenericSansSerif, 12, FontStyle.Bold);
        }
开发者ID:Digresiv,项目名称:garminworkouts,代码行数:30,代码来源:WorkoutPrintDocument.cs


示例9: OnStartPrint

        public override void OnStartPrint(PrintDocument document, PrintEventArgs e) {
            Debug.Assert(dc == null && graphics == null, "PrintController methods called in the wrong order?");

            // For security purposes, don't assume our public methods methods are called in any particular order
            CheckSecurity(document);

            base.OnStartPrint(document, e);
            // the win32 methods below SuppressUnmanagedCodeAttributes so assertin on UnmanagedCodePermission is redundant
            if (!document.PrinterSettings.IsValid)
                throw new InvalidPrinterException(document.PrinterSettings);

            dc = document.PrinterSettings.CreateDeviceContext(modeHandle);
            SafeNativeMethods.DOCINFO info = new SafeNativeMethods.DOCINFO();
            info.lpszDocName = document.DocumentName;
            if (document.PrinterSettings.PrintToFile)
                info.lpszOutput = document.PrinterSettings.OutputPort; //This will be "FILE:"
            else
                info.lpszOutput = null;
            info.lpszDatatype = null;
            info.fwType = 0;

            int result = SafeNativeMethods.StartDoc(new HandleRef(this.dc, dc.Hdc), info);
            if (result <= 0) {
                int error = Marshal.GetLastWin32Error();
                if (error == SafeNativeMethods.ERROR_CANCELLED) {
                    e.Cancel = true;
                }
                else {
                    throw new Win32Exception(error);
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:32,代码来源:DefaultPrintController.cs


示例10: OnBeginPrint

		/// <summary>
		/// Raises the System.Drawing.Printing.PrintDocument.BeginPrint event. It is called
		/// after the System.Drawing.Printing.PrintDocument.Print method is called and before
		/// the first page of the document prints.
		/// </summary>
		/// <param name="e">A System.Drawing.Printing.PrintEventArgs that contains the event data.</param>
		protected override void OnBeginPrint(PrintEventArgs e)
		{
			base.OnBeginPrint(e);

			//Calculate range of pages for print
			switch (PrinterSettings.PrintRange)
			{
				case PrintRange.Selection:
				case PrintRange.CurrentPage: //Curent page
					PrinterSettings.FromPage = _pdfDoc.Pages.CurrentIndex + 1;
					PrinterSettings.ToPage = _pdfDoc.Pages.CurrentIndex + 1;
					break;
				case PrintRange.SomePages: //The range specified by the user
					break;
				default: //All pages
					PrinterSettings.FromPage = PrinterSettings.MinimumPage;
					PrinterSettings.ToPage = PrinterSettings.MaximumPage;
					break;
			}

			_docForPrint = InitDocument();
			if (_docForPrint == IntPtr.Zero)
			{
				e.Cancel = true;
				return;
			}
			_pageForPrint = _useDP ? 0 : PrinterSettings.FromPage - 1;
		}
开发者ID:Patagames,项目名称:Pdf.Wpf,代码行数:34,代码来源:PdfPrintDocument.cs


示例11: OnStartPrint

        /// <include file='doc\PrintControllerWithStatusDialog.uex' path='docs/doc[@for="PrintControllerWithStatusDialog.OnStartPrint"]/*' />
        /// <internalonly/>
        /// <devdoc>
        ///    <para>
        ///       Implements StartPrint by delegating to the underlying controller.
        ///    </para>
        /// </devdoc>
        public override void OnStartPrint(PrintDocument document, PrintEventArgs e) {
            base.OnStartPrint(document, e);

            this.document = document;
            pageNumber = 1;

            if (SystemInformation.UserInteractive) {
                backgroundThread = new BackgroundThread(this); // starts running & shows dialog automatically
            }

            // OnStartPrint does the security check... lots of 
            // extra setup to make sure that we tear down
            // correctly...
            //
            try {
                underlyingController.OnStartPrint(document, e);
            }
            catch {
                if (backgroundThread != null) {
                    backgroundThread.Stop();
                }
                throw;
            }
            finally {
                if (backgroundThread != null && backgroundThread.canceled) {
                    e.Cancel = true;
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:36,代码来源:PrintControllerWithStatusDialog.cs


示例12: OnBeginPrint

        /// <summary>
        /// Performs processing when printing begins</summary>
        /// <param name="e">Event args</param>
        protected override void OnBeginPrint(PrintEventArgs e)
        {
            base.OnBeginPrint(e);
            m_font = new Font("Courier", 10);

            if (m_fileName != null)
            {
                try
                {
                    m_streamReader = new StreamReader(m_fileName);
                }
                catch (FileNotFoundException)
                {
                    e.Cancel = true;
                }
            }
            else if (m_stream != null)
            {
                m_streamReader = new StreamReader(m_stream);

            }
            else
                e.Cancel = true;

        }
开发者ID:JanDeHud,项目名称:LevelEditor,代码行数:28,代码来源:TextPrintDocument.cs


示例13: OnStartPrint

 public override void OnStartPrint(PrintDocument document, PrintEventArgs e)
 {
     base.OnStartPrint(document, e);
     this.document = document;
     this.pageNumber = 1;
     if (SystemInformation.UserInteractive)
     {
         this.backgroundThread = new BackgroundThread(this);
     }
     try
     {
         this.underlyingController.OnStartPrint(document, e);
     }
     catch
     {
         if (this.backgroundThread != null)
         {
             this.backgroundThread.Stop();
         }
         throw;
     }
     finally
     {
         if ((this.backgroundThread != null) && this.backgroundThread.canceled)
         {
             e.Cancel = true;
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:PrintControllerWithStatusDialog.cs


示例14: OnEndPrint

 public override void OnEndPrint(PrintDocument document, PrintEventArgs e)
 {
     this.CheckSecurity();
     this.dc.Dispose();
     this.dc = null;
     base.OnEndPrint(document, e);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:PreviewPrintController.cs


示例15: OnEndPrint

 public override void OnEndPrint(PrintDocument document, PrintEventArgs e)
 {
     this.CheckSecurity(document);
     System.Drawing.IntSecurity.UnmanagedCode.Assert();
     try
     {
         if (this.dc != null)
         {
             try
             {
                 int num = e.Cancel ? SafeNativeMethods.AbortDoc(new HandleRef(this.dc, this.dc.Hdc)) : SafeNativeMethods.EndDoc(new HandleRef(this.dc, this.dc.Hdc));
                 if (num <= 0)
                 {
                     throw new Win32Exception();
                 }
             }
             finally
             {
                 this.dc.Dispose();
                 this.dc = null;
             }
         }
     }
     finally
     {
         CodeAccessPermission.RevertAssert();
     }
     base.OnEndPrint(document, e);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:StandardPrintController.cs


示例16: OnBeginPrint

 protected virtual void OnBeginPrint(PrintEventArgs e)
 {
     if (this.beginPrintHandler != null)
     {
         this.beginPrintHandler(this, e);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:PrintDocument.cs


示例17: Print

 internal void Print(PrintDocument document)
 {
     PrintAction printToPreview;
     IntSecurity.SafePrinting.Demand();
     if (this.IsPreview)
     {
         printToPreview = PrintAction.PrintToPreview;
     }
     else
     {
         printToPreview = document.PrinterSettings.PrintToFile ? PrintAction.PrintToFile : PrintAction.PrintToPrinter;
     }
     PrintEventArgs e = new PrintEventArgs(printToPreview);
     document._OnBeginPrint(e);
     if (e.Cancel)
     {
         document._OnEndPrint(e);
     }
     else
     {
         this.OnStartPrint(document, e);
         if (e.Cancel)
         {
             document._OnEndPrint(e);
             this.OnEndPrint(document, e);
         }
         else
         {
             bool flag = true;
             try
             {
                 flag = this.PrintLoop(document);
             }
             finally
             {
                 try
                 {
                     try
                     {
                         document._OnEndPrint(e);
                         e.Cancel = flag | e.Cancel;
                     }
                     finally
                     {
                         this.OnEndPrint(document, e);
                     }
                 }
                 finally
                 {
                     if (!IntSecurity.HasPermission(IntSecurity.AllPrinting))
                     {
                         IntSecurity.AllPrinting.Assert();
                         document.PrinterSettings.PrintDialogDisplayed = false;
                     }
                 }
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:59,代码来源:PrintController.cs


示例18: OnBeginPrint

		//Override OnBeginPrint to set up the font we are going to use
		protected override void OnBeginPrint(PrintEventArgs ev) 
		{
			base.OnBeginPrint(ev) ;
			printHeaderFont = new Font("Arial", 14,System.Drawing.FontStyle.Bold);

			printCompetitorFont = new Font("Arial", 10, System.Drawing.FontStyle.Regular);
			printAllbergFont = new Font("Arial", 8, System.Drawing.FontStyle.Regular);
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:9,代码来源:CPrintPatrollistByUser.cs


示例19: OnEndPrint

 public virtual void OnEndPrint(PrintDocument document, PrintEventArgs e)
 {
     IntSecurity.UnmanagedCode.Assert();
     if (this.modeHandle != null)
     {
         this.modeHandle.Close();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:PrintController.cs


示例20: pd_EndPrint

 void pd_EndPrint(object sender, PrintEventArgs e)
 {
     //Cleanup: may get called multiple times
     foreach (var s in _PrintingStreams) s.Dispose();
     _PrintingStreams.Clear();
     //And reset for next time
     _PrintingIndex = 0;
 }
开发者ID:itcthienkhiem,项目名称:DienLucHocMonCT,代码行数:8,代码来源:frmReport_The_kho.cs



注:本文中的System.Drawing.Printing.PrintEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Printing.PrintPageEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Printing.PrintDocument类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap