Code:
/ 4.0 / 4.0 / 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.
//------------------------------------------------------------------------------
//
// 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
- DebugTraceHelper.cs
- ValidationHelpers.cs
- ClientProxyGenerator.cs
- BitmapEffectRenderDataResource.cs
- NoResizeSelectionBorderGlyph.cs
- lengthconverter.cs
- LocalTransaction.cs
- BuildManagerHost.cs
- InstanceNotReadyException.cs
- CodeGen.cs
- Slider.cs
- SafeLocalAllocation.cs
- QuaternionAnimation.cs
- PartialClassGenerationTask.cs
- AsymmetricAlgorithm.cs
- BufferBuilder.cs
- PeerApplicationLaunchInfo.cs
- SafeNativeMethods.cs
- XPathNodeHelper.cs
- StrongNameIdentityPermission.cs
- PrimitiveSchema.cs
- TextShapeableCharacters.cs
- MaskedTextBox.cs
- CqlGenerator.cs
- DataRowChangeEvent.cs
- RequestCachePolicyConverter.cs
- DataGridViewRowEventArgs.cs
- ResXResourceWriter.cs
- LinkClickEvent.cs
- RestHandlerFactory.cs
- ClientRuntimeConfig.cs
- SmtpAuthenticationManager.cs
- ServiceThrottlingBehavior.cs
- WebPartEditorOkVerb.cs
- OperationCanceledException.cs
- ConstraintEnumerator.cs
- XmlSchemaSimpleType.cs
- SourceFileBuildProvider.cs
- SimpleWebHandlerParser.cs
- RoutedEvent.cs
- FileAuthorizationModule.cs
- ImageSourceValueSerializer.cs
- ProviderCollection.cs
- LinkedList.cs
- SettingsProviderCollection.cs
- ConfigurationManagerHelper.cs
- HostingEnvironmentSection.cs
- StructuralCache.cs
- ContentElementAutomationPeer.cs
- COSERVERINFO.cs
- MetaType.cs
- SQLDoubleStorage.cs
- PlainXmlSerializer.cs
- BaseEntityWrapper.cs
- ALinqExpressionVisitor.cs
- HtmlTableCellCollection.cs
- BamlLocalizabilityResolver.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- __ConsoleStream.cs
- DataGridViewRowPrePaintEventArgs.cs
- GZipStream.cs
- RoleManagerModule.cs
- PointAnimationUsingKeyFrames.cs
- CommandBinding.cs
- PrimitiveXmlSerializers.cs
- ToolStripItemTextRenderEventArgs.cs
- XmlUTF8TextReader.cs
- XmlSchemaCollection.cs
- FilterQuery.cs
- PersonalizationAdministration.cs
- WeakReference.cs
- RealizedColumnsBlock.cs
- ColumnTypeConverter.cs
- Frame.cs
- WindowsSlider.cs
- ResXResourceReader.cs
- EntitySqlQueryCacheKey.cs
- _ConnectStream.cs
- DetailsViewDeleteEventArgs.cs
- SoapSchemaImporter.cs
- SessionPageStatePersister.cs
- IsolatedStorageException.cs
- TemplateXamlParser.cs
- VisualCollection.cs
- CheckBox.cs
- EntitySetBaseCollection.cs
- BlurEffect.cs
- BamlRecordReader.cs
- SEHException.cs
- BindingListCollectionView.cs
- WebPartTransformer.cs
- VersionValidator.cs
- StrongNameIdentityPermission.cs
- DataGridCommandEventArgs.cs
- MimeWriter.cs
- arc.cs
- ControlPaint.cs
- HttpWebResponse.cs
- RSACryptoServiceProvider.cs
- CssTextWriter.cs