Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CommonUI / System / Drawing / Printing / PaperSource.cs / 1 / PaperSource.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Drawing.Printing {
using System.Runtime.Serialization.Formatters;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System;
using System.Drawing;
using System.ComponentModel;
using Microsoft.Win32;
///
///
///
/// Specifies the paper tray from which the printer gets paper.
///
///
[Serializable]
public class PaperSource {
private string name;
private PaperSourceKind kind;
///
///
///
/// Initializes a new instance of the class with default properties.
/// This constructor is required for the serialization of the class.
///
///
public PaperSource()
{
this.kind = PaperSourceKind.Custom;
this.name = String.Empty;
}
internal PaperSource(PaperSourceKind kind, string name) {
this.kind = kind;
this.name = name;
}
///
///
///
/// Gets
/// a value indicating the type of paper source.
///
///
///
public PaperSourceKind Kind {
get {
if (((int) kind) >= SafeNativeMethods.DMBIN_USER)
return PaperSourceKind.Custom;
else
return kind;
}
}
///
///
///
/// Same as Kind, but values larger than DMBIN_USER do not map to PaperSourceKind.Custom.
/// This property is needed for serialization of the PrinterSettings object.
///
///
public int RawKind
{
get { return (int) kind; }
set { kind = (PaperSourceKind) value; }
}
///
///
///
/// Gets the name of the paper source.
/// Setter is added for serialization of the PrinterSettings object.
///
///
public string SourceName {
get { return name;}
set { name = value; }
}
///
///
///
///
/// Provides some interesting information about the PaperSource in
/// String form.
///
///
public override string ToString() {
return "[PaperSource " + SourceName
+ " Kind=" + TypeDescriptor.GetConverter(typeof(PaperSourceKind)).ConvertToString(Kind)
+ "]";
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InkCanvasSelection.cs
- SQLMoney.cs
- GregorianCalendar.cs
- InputProcessorProfiles.cs
- PathNode.cs
- TextParentUndoUnit.cs
- ObjectHandle.cs
- XmlSerializerVersionAttribute.cs
- FontResourceCache.cs
- DirectoryInfo.cs
- WebBaseEventKeyComparer.cs
- IMembershipProvider.cs
- RenderingEventArgs.cs
- UITypeEditor.cs
- CqlParserHelpers.cs
- BamlRecordReader.cs
- QueryStringParameter.cs
- Canvas.cs
- CommonGetThemePartSize.cs
- ProfilePropertyMetadata.cs
- IndexedString.cs
- FreeFormDesigner.cs
- MaterialGroup.cs
- HitTestParameters3D.cs
- Base64Encoder.cs
- XPathExpr.cs
- RegisteredDisposeScript.cs
- ToolStripContentPanelRenderEventArgs.cs
- ListParagraph.cs
- XmlSchemaSimpleTypeRestriction.cs
- Dictionary.cs
- GZipStream.cs
- RenderCapability.cs
- EventOpcode.cs
- XsdDuration.cs
- DbBuffer.cs
- VBCodeProvider.cs
- ToolStripItem.cs
- SpellerInterop.cs
- DataServiceKeyAttribute.cs
- ToolStripComboBox.cs
- Serializer.cs
- ToolStripComboBox.cs
- TableCellCollection.cs
- OleDbPermission.cs
- DataGridViewRowStateChangedEventArgs.cs
- SchemaImporter.cs
- WindowPattern.cs
- UInt64Converter.cs
- UrlUtility.cs
- ListView.cs
- WebPartAddingEventArgs.cs
- ToolStrip.cs
- ListBase.cs
- FileLoadException.cs
- XmlElementAttribute.cs
- PropertyGroupDescription.cs
- EmissiveMaterial.cs
- DispatcherSynchronizationContext.cs
- RbTree.cs
- TransformerConfigurationWizardBase.cs
- DbSourceCommand.cs
- ToolStripContainerDesigner.cs
- LoadWorkflowByKeyAsyncResult.cs
- EntitySet.cs
- DeliveryRequirementsAttribute.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- DialogWindow.cs
- TextFormattingConverter.cs
- XsltContext.cs
- Page.cs
- WeakReadOnlyCollection.cs
- ProcessThreadCollection.cs
- TextChange.cs
- LogLogRecordEnumerator.cs
- ImmutableObjectAttribute.cs
- ClientConfigurationHost.cs
- Package.cs
- Mutex.cs
- StrokeRenderer.cs
- DecimalKeyFrameCollection.cs
- WindowsPen.cs
- AttributeQuery.cs
- _NegotiateClient.cs
- NativeStructs.cs
- NopReturnReader.cs
- TemplatePropertyEntry.cs
- ByteAnimationUsingKeyFrames.cs
- Pen.cs
- FileDialogCustomPlace.cs
- HandlerBase.cs
- ToolboxItemCollection.cs
- NodeInfo.cs
- IriParsingElement.cs
- RichTextBox.cs
- CheckBox.cs
- GenericIdentity.cs
- StrongNameMembershipCondition.cs
- TimeoutConverter.cs
- TimeZoneNotFoundException.cs