Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / Printing / PaperSource.cs / 1305376 / 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.
//
//-----------------------------------------------------------------------------
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AnnotationHighlightLayer.cs
- ObjectContextServiceProvider.cs
- FontInfo.cs
- SoapParser.cs
- PlaceHolder.cs
- HotCommands.cs
- FileRegion.cs
- SlotInfo.cs
- EntityDataSourceChangingEventArgs.cs
- SiteMapSection.cs
- ExtendedPropertyDescriptor.cs
- RoleGroup.cs
- BaseAutoFormat.cs
- ReferenceEqualityComparer.cs
- SqlDataSourceView.cs
- WeakReadOnlyCollection.cs
- XPathEmptyIterator.cs
- TypeResolvingOptionsAttribute.cs
- ReadOnlyCollectionBuilder.cs
- HwndProxyElementProvider.cs
- MultiView.cs
- TrailingSpaceComparer.cs
- ThreadPoolTaskScheduler.cs
- ToolStripMenuItemCodeDomSerializer.cs
- SelectionItemProviderWrapper.cs
- FormViewDesigner.cs
- _AutoWebProxyScriptEngine.cs
- MemoryPressure.cs
- CompilerState.cs
- GridViewRow.cs
- OletxTransactionHeader.cs
- NodeFunctions.cs
- EventData.cs
- Canvas.cs
- ThreadBehavior.cs
- DataSourceControlBuilder.cs
- VideoDrawing.cs
- NameValueConfigurationCollection.cs
- EntryPointNotFoundException.cs
- LogEntrySerialization.cs
- XmlNullResolver.cs
- ViewCellRelation.cs
- DropDownList.cs
- DiscoveryDocumentReference.cs
- StatusBarAutomationPeer.cs
- ComponentEvent.cs
- FragmentNavigationEventArgs.cs
- ObjectSerializerFactory.cs
- ClientScriptItemCollection.cs
- ToolStripDropTargetManager.cs
- SvcMapFileLoader.cs
- DateTimeOffsetStorage.cs
- TargetControlTypeCache.cs
- CompilerParameters.cs
- Win32MouseDevice.cs
- FixedStringLookup.cs
- OleDbConnection.cs
- PropertyIDSet.cs
- Point3DCollection.cs
- AuthenticationManager.cs
- DataGridViewRowEventArgs.cs
- Queue.cs
- SqlComparer.cs
- xsdvalidator.cs
- Soap12ProtocolImporter.cs
- ActivationServices.cs
- Effect.cs
- InvalidOperationException.cs
- DecimalFormatter.cs
- TextDecorationCollection.cs
- HttpCookiesSection.cs
- ScopelessEnumAttribute.cs
- IItemProperties.cs
- ServiceHttpModule.cs
- ThreadNeutralSemaphore.cs
- Tablet.cs
- AssemblyAttributes.cs
- ToolStripRenderEventArgs.cs
- ToolStripItemDesigner.cs
- AuthenticationService.cs
- WrappingXamlSchemaContext.cs
- SingleStorage.cs
- WindowsRichEdit.cs
- TabPanel.cs
- SQLGuidStorage.cs
- CompositeScriptReference.cs
- StateRuntime.cs
- GridItem.cs
- TextTreeInsertUndoUnit.cs
- DataBindingCollection.cs
- CommandManager.cs
- MergablePropertyAttribute.cs
- FormClosedEvent.cs
- StoragePropertyMapping.cs
- XmlDocumentType.cs
- SmiConnection.cs
- XmlSchemaValidationException.cs
- QuotedPrintableStream.cs
- VerificationAttribute.cs
- DataGridParentRows.cs