Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / Printing / PrintPageEvent.cs / 1305376 / PrintPageEvent.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Drawing.Printing {
using System.Diagnostics;
using System;
using System.Drawing;
using System.ComponentModel;
using Microsoft.Win32;
///
///
/// Provides data for the
/// event.
///
// NOTE: Please keep this class consistent with PaintEventArgs.
public class PrintPageEventArgs : EventArgs {
private bool hasMorePages;
private bool cancel;
private Graphics graphics;
private readonly Rectangle marginBounds;
private readonly Rectangle pageBounds;
private readonly PageSettings pageSettings;
///
///
/// Initializes a new instance of the class.
///
public PrintPageEventArgs(Graphics graphics, Rectangle marginBounds, Rectangle pageBounds, PageSettings pageSettings) {
this.graphics = graphics; // may be null, see PrintController
this.marginBounds = marginBounds;
this.pageBounds = pageBounds;
this.pageSettings = pageSettings;
}
///
///
/// Gets or sets a value indicating whether the print job should be canceled.
///
public bool Cancel {
get { return cancel;}
set { cancel = value;}
}
///
///
///
/// Gets the
/// used to paint the
/// item.
///
///
public Graphics Graphics {
get {
return graphics;
}
}
///
///
/// Gets or sets a value indicating whether an additional page should
/// be printed.
///
public bool HasMorePages {
get { return hasMorePages;}
set { hasMorePages = value;}
}
///
///
/// Gets the rectangular area that represents the portion of the page between the margins.
///
public Rectangle MarginBounds {
get {
return marginBounds;
}
}
///
///
///
/// Gets the rectangular area that represents the total area of the page.
///
///
public Rectangle PageBounds {
get {
return pageBounds;
}
}
///
///
/// Gets
/// the page settings for the current page.
///
public PageSettings PageSettings {
get {
return pageSettings;
}
}
///
///
/// Disposes
/// of the resources (other than memory) used by
/// the .
///
// We want a way to dispose the GDI+ Graphics, but we don't want to create one
// simply to dispose it
internal void Dispose() {
graphics.Dispose();
}
internal void SetGraphics(Graphics value) {
this.graphics = value;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DynamicDocumentPaginator.cs
- PropertyIdentifier.cs
- CharacterString.cs
- XmlSchemaComplexContent.cs
- SqlNotificationRequest.cs
- FactoryRecord.cs
- WebExceptionStatus.cs
- AsyncContentLoadedEventArgs.cs
- TabControl.cs
- SqlGenericUtil.cs
- HtmlMeta.cs
- XmlMembersMapping.cs
- DbConnectionPoolIdentity.cs
- PointUtil.cs
- CodeCatchClause.cs
- ChtmlCommandAdapter.cs
- ClientUtils.cs
- ExpandableObjectConverter.cs
- RequestBringIntoViewEventArgs.cs
- __ComObject.cs
- ProgressPage.cs
- FontStretches.cs
- AssemblyNameProxy.cs
- XmlNamespaceManager.cs
- FamilyTypefaceCollection.cs
- GraphicsPath.cs
- HealthMonitoringSectionHelper.cs
- ClosableStream.cs
- WindowsRichEdit.cs
- XmlEncoding.cs
- ConversionContext.cs
- XmlSchemaValidationException.cs
- NetworkAddressChange.cs
- Button.cs
- HtmlControl.cs
- CodeMemberEvent.cs
- LockedAssemblyCache.cs
- ColorConverter.cs
- LayoutTableCell.cs
- PeerTransportListenAddressValidatorAttribute.cs
- ListBase.cs
- HttpHeaderCollection.cs
- HttpCookiesSection.cs
- SqlDataSourceEnumerator.cs
- DesignerActionList.cs
- Base64Stream.cs
- CannotUnloadAppDomainException.cs
- CircleHotSpot.cs
- documentsequencetextview.cs
- Grid.cs
- _IPv4Address.cs
- PersonalizationStateInfoCollection.cs
- UnsafeNativeMethodsCLR.cs
- Funcletizer.cs
- Matrix3DStack.cs
- ContextMenuStrip.cs
- DataFormats.cs
- StructuralObject.cs
- DrawingImage.cs
- FilePresentation.cs
- MetadataCollection.cs
- TextEditorDragDrop.cs
- WebPartTransformerAttribute.cs
- BlurBitmapEffect.cs
- DecimalAverageAggregationOperator.cs
- CustomAttributeFormatException.cs
- CollectionTraceRecord.cs
- AsyncOperation.cs
- ProcessActivityTreeOptions.cs
- SimpleBitVector32.cs
- ProfileGroupSettings.cs
- TextEditorDragDrop.cs
- CodeIterationStatement.cs
- SkewTransform.cs
- DataDocumentXPathNavigator.cs
- SecurityRuntime.cs
- HelpPage.cs
- TypeSystemProvider.cs
- SynchronizedDisposablePool.cs
- Pkcs9Attribute.cs
- OracleBoolean.cs
- AccessDataSource.cs
- AttributeData.cs
- AtomServiceDocumentSerializer.cs
- NativeObjectSecurity.cs
- SetterBaseCollection.cs
- PropertiesTab.cs
- TransactionChannelFaultConverter.cs
- KeyValueSerializer.cs
- GlobalizationAssembly.cs
- MatrixAnimationUsingPath.cs
- Visual3D.cs
- WorkflowRuntime.cs
- InputScopeManager.cs
- ProviderCommandInfoUtils.cs
- DrawListViewColumnHeaderEventArgs.cs
- MembershipPasswordException.cs
- ProfileSettingsCollection.cs
- shaperfactoryquerycachekey.cs
- Geometry.cs