Code:
/ FX-1434 / FX-1434 / 1.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
- StrokeCollection.cs
- TcpProcessProtocolHandler.cs
- OdbcRowUpdatingEvent.cs
- StandardCommandToolStripMenuItem.cs
- ObservableCollectionDefaultValueFactory.cs
- Types.cs
- ContainerFilterService.cs
- ToolboxControl.cs
- DispatcherEventArgs.cs
- BackgroundFormatInfo.cs
- KerberosRequestorSecurityTokenAuthenticator.cs
- DefaultValueAttribute.cs
- LineUtil.cs
- _BasicClient.cs
- HyperLinkField.cs
- ErrorHandlerFaultInfo.cs
- SessionStateSection.cs
- TitleStyle.cs
- DataObjectSettingDataEventArgs.cs
- BitConverter.cs
- Binding.cs
- XsltConvert.cs
- isolationinterop.cs
- TargetPerspective.cs
- FreeFormDragDropManager.cs
- SecurityUtils.cs
- DataGridCheckBoxColumn.cs
- Sequence.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- DataGridCell.cs
- XamlStyleSerializer.cs
- ContentOperations.cs
- LinqExpressionNormalizer.cs
- MailMessage.cs
- BamlRecordWriter.cs
- _KerberosClient.cs
- objectresult_tresulttype.cs
- SystemInfo.cs
- GeometryConverter.cs
- SplineQuaternionKeyFrame.cs
- TextParagraphProperties.cs
- HtmlHistory.cs
- OuterGlowBitmapEffect.cs
- ModuleBuilder.cs
- TabPanel.cs
- RecognizedWordUnit.cs
- MobileCapabilities.cs
- WebPartMinimizeVerb.cs
- WebPartEventArgs.cs
- GeometryGroup.cs
- HashRepartitionEnumerator.cs
- DBCommandBuilder.cs
- ChannelDispatcher.cs
- EmptyQuery.cs
- WindowsListView.cs
- activationcontext.cs
- GatewayIPAddressInformationCollection.cs
- CompositeScriptReference.cs
- HttpCapabilitiesSectionHandler.cs
- TextBox.cs
- PanelStyle.cs
- QueryCursorEventArgs.cs
- __ComObject.cs
- DataGridPageChangedEventArgs.cs
- RequestQueue.cs
- ToolStripRenderEventArgs.cs
- XmlSchemaValidator.cs
- SR.cs
- CodeCommentStatementCollection.cs
- TypeCodeDomSerializer.cs
- TreeBuilderBamlTranslator.cs
- SchemaElementLookUpTableEnumerator.cs
- ReadOnlyNameValueCollection.cs
- _HeaderInfoTable.cs
- Camera.cs
- mediaeventshelper.cs
- SafeNativeMemoryHandle.cs
- SqlStream.cs
- WrapperEqualityComparer.cs
- _Rfc2616CacheValidators.cs
- WindowsFormsLinkLabel.cs
- VariantWrapper.cs
- CompilerGeneratedAttribute.cs
- Triangle.cs
- DataMemberConverter.cs
- ModifierKeysValueSerializer.cs
- ReturnValue.cs
- DataReaderContainer.cs
- SpotLight.cs
- Nodes.cs
- CompiledIdentityConstraint.cs
- UInt64Storage.cs
- precedingquery.cs
- XhtmlBasicLiteralTextAdapter.cs
- MouseBinding.cs
- DataTableClearEvent.cs
- RoleBoolean.cs
- TemplateBindingExtensionConverter.cs
- Models.cs
- SByte.cs