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; ////// /// [Serializable] public class PaperSource { private string name; private PaperSourceKind kind; ////// Specifies the paper tray from which the printer gets paper. /// ////// /// public PaperSource() { this.kind = PaperSourceKind.Custom; this.name = String.Empty; } internal PaperSource(PaperSourceKind kind, string name) { this.kind = kind; this.name = name; } ////// Initializes a new instance of the ///class with default properties. /// This constructor is required for the serialization of the class. /// /// /// public PaperSourceKind Kind { get { if (((int) kind) >= SafeNativeMethods.DMBIN_USER) return PaperSourceKind.Custom; else return kind; } } ////// Gets /// a value indicating the type of paper source. /// /// ////// /// public int RawKind { get { return (int) kind; } set { kind = (PaperSourceKind) value; } } ////// 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 string SourceName { get { return name;} set { name = value; } } ////// Gets the name of the paper source. /// Setter is added for serialization of the PrinterSettings object. /// ////// /// /// 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. //------------------------------------------------------------------------------ ///// Provides some interesting information about the PaperSource in /// String form. /// ///// 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; ////// /// [Serializable] public class PaperSource { private string name; private PaperSourceKind kind; ////// Specifies the paper tray from which the printer gets paper. /// ////// /// public PaperSource() { this.kind = PaperSourceKind.Custom; this.name = String.Empty; } internal PaperSource(PaperSourceKind kind, string name) { this.kind = kind; this.name = name; } ////// Initializes a new instance of the ///class with default properties. /// This constructor is required for the serialization of the class. /// /// /// public PaperSourceKind Kind { get { if (((int) kind) >= SafeNativeMethods.DMBIN_USER) return PaperSourceKind.Custom; else return kind; } } ////// Gets /// a value indicating the type of paper source. /// /// ////// /// public int RawKind { get { return (int) kind; } set { kind = (PaperSourceKind) value; } } ////// 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 string SourceName { get { return name;} set { name = value; } } ////// Gets the name of the paper source. /// Setter is added for serialization of the PrinterSettings object. /// ////// /// /// 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./// Provides some interesting information about the PaperSource in /// String form. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TargetInvocationException.cs
- FileSecurity.cs
- AutomationEventArgs.cs
- DragEventArgs.cs
- Events.cs
- Logging.cs
- SettingsProperty.cs
- ToolStripDesignerAvailabilityAttribute.cs
- TextEffect.cs
- XmlDownloadManager.cs
- RenderingBiasValidation.cs
- UnconditionalPolicy.cs
- PeerUnsafeNativeMethods.cs
- BitmapEffectDrawingContextWalker.cs
- HttpPostedFile.cs
- ScrollContentPresenter.cs
- BinHexEncoding.cs
- ComponentResourceManager.cs
- RSAPKCS1SignatureFormatter.cs
- DbConnectionPoolGroup.cs
- HideDisabledControlAdapter.cs
- OperatorExpressions.cs
- PlanCompilerUtil.cs
- FrameworkElementFactory.cs
- SwitchAttribute.cs
- ContentDefinition.cs
- SeparatorAutomationPeer.cs
- ImageListUtils.cs
- PageAsyncTaskManager.cs
- SessionEndingEventArgs.cs
- HighlightComponent.cs
- DesignerDataParameter.cs
- SingleResultAttribute.cs
- ParameterEditorUserControl.cs
- EntitySqlQueryBuilder.cs
- MsmqBindingBase.cs
- SerialStream.cs
- FixedPage.cs
- UTF8Encoding.cs
- Camera.cs
- Boolean.cs
- WindowsGrip.cs
- NullExtension.cs
- ReversePositionQuery.cs
- ExpressionSelection.cs
- UnsafeNativeMethods.cs
- PropertyIDSet.cs
- JsonObjectDataContract.cs
- EncoderNLS.cs
- CompilerState.cs
- CatalogPartChrome.cs
- InputProcessorProfilesLoader.cs
- DataGridAddNewRow.cs
- ResourceReferenceExpressionConverter.cs
- EntityDataSourceSelectedEventArgs.cs
- ClientSponsor.cs
- DiscoveryEndpointElement.cs
- XmlElementList.cs
- WebServiceMethodData.cs
- MimeParameterWriter.cs
- XmlSerializableReader.cs
- Font.cs
- CounterCreationDataCollection.cs
- odbcmetadatacollectionnames.cs
- DispatcherObject.cs
- DesignerFrame.cs
- DataBoundControlAdapter.cs
- InputLangChangeEvent.cs
- RoutedEventConverter.cs
- DataGridViewDataConnection.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- ImmComposition.cs
- FileDialog_Vista_Interop.cs
- FigureHelper.cs
- _ProxyRegBlob.cs
- WithParamAction.cs
- ByteViewer.cs
- SqlParameterCollection.cs
- Facet.cs
- ProxyHwnd.cs
- EncoderBestFitFallback.cs
- SAPIEngineTypes.cs
- EncoderBestFitFallback.cs
- MethodImplAttribute.cs
- DesignerOptionService.cs
- ValidatorUtils.cs
- wmiprovider.cs
- XXXInfos.cs
- XmlLanguage.cs
- DataGridTextBoxColumn.cs
- ExpressionBuilder.cs
- StylusEventArgs.cs
- SvcFileManager.cs
- QilIterator.cs
- PersistenceTypeAttribute.cs
- ProfileBuildProvider.cs
- SqlDataSourceQueryEditor.cs
- AliasedExpr.cs
- IPEndPoint.cs
- RadioButtonFlatAdapter.cs