Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CommonUI / System / Drawing / Printing / PrinterResolution.cs / 1 / PrinterResolution.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.Diagnostics.CodeAnalysis; using System; using System.Drawing; using System.ComponentModel; using Microsoft.Win32; using System.Globalization; ////// /// [Serializable] public class PrinterResolution { private int x; private int y; private PrinterResolutionKind kind; ///Retrieves /// the resolution supported by a printer. ////// /// public PrinterResolution() { this.kind = PrinterResolutionKind.Custom; } internal PrinterResolution(PrinterResolutionKind kind, int x, int y) { this.kind = kind; this.x = x; this.y = y; } ////// Initializes a new instance of the ///class with default properties. /// This constructor is required for the serialization of the class. /// /// /// public PrinterResolutionKind Kind { get { return kind;} set { //valid values are 0xfffffffc to 0x0 if (!ClientUtils.IsEnumValid(value, (int)value, (int)PrinterResolutionKind.High, (int)PrinterResolutionKind.Custom)) { throw new InvalidEnumArgumentException("value", (int)value, typeof(PrinterResolutionKind)); } kind = value; } } ////// Gets /// a value indicating the kind of printer resolution. /// Setter added to enable serialization of the PrinterSettings object. /// ////// /// public int X { get { return x; } set { x = value; } } ////// Gets the printer resolution in the horizontal direction, /// in dots per inch. /// Setter added to enable serialization of the PrinterSettings object. /// ////// /// public int Y { get { return y; } set { y = value; } } ///Gets the printer resolution in the vertical direction, /// in dots per inch. /// Setter added to enable serialization of the PrinterSettings object. /// ////// /// /// public override string ToString() { if (kind != PrinterResolutionKind.Custom) return "[PrinterResolution " + TypeDescriptor.GetConverter(typeof(PrinterResolutionKind)).ConvertToString((int) Kind) + "]"; else return "[PrinterResolution" + " X=" + X.ToString(CultureInfo.InvariantCulture) + " Y=" + Y.ToString(CultureInfo.InvariantCulture) + "]"; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ ///// Provides some interesting information about the PrinterResolution 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.Diagnostics.CodeAnalysis; using System; using System.Drawing; using System.ComponentModel; using Microsoft.Win32; using System.Globalization; ////// /// [Serializable] public class PrinterResolution { private int x; private int y; private PrinterResolutionKind kind; ///Retrieves /// the resolution supported by a printer. ////// /// public PrinterResolution() { this.kind = PrinterResolutionKind.Custom; } internal PrinterResolution(PrinterResolutionKind kind, int x, int y) { this.kind = kind; this.x = x; this.y = y; } ////// Initializes a new instance of the ///class with default properties. /// This constructor is required for the serialization of the class. /// /// /// public PrinterResolutionKind Kind { get { return kind;} set { //valid values are 0xfffffffc to 0x0 if (!ClientUtils.IsEnumValid(value, (int)value, (int)PrinterResolutionKind.High, (int)PrinterResolutionKind.Custom)) { throw new InvalidEnumArgumentException("value", (int)value, typeof(PrinterResolutionKind)); } kind = value; } } ////// Gets /// a value indicating the kind of printer resolution. /// Setter added to enable serialization of the PrinterSettings object. /// ////// /// public int X { get { return x; } set { x = value; } } ////// Gets the printer resolution in the horizontal direction, /// in dots per inch. /// Setter added to enable serialization of the PrinterSettings object. /// ////// /// public int Y { get { return y; } set { y = value; } } ///Gets the printer resolution in the vertical direction, /// in dots per inch. /// Setter added to enable serialization of the PrinterSettings object. /// ////// /// /// public override string ToString() { if (kind != PrinterResolutionKind.Custom) return "[PrinterResolution " + TypeDescriptor.GetConverter(typeof(PrinterResolutionKind)).ConvertToString((int) Kind) + "]"; else return "[PrinterResolution" + " X=" + X.ToString(CultureInfo.InvariantCulture) + " Y=" + Y.ToString(CultureInfo.InvariantCulture) + "]"; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007./// Provides some interesting information about the PrinterResolution in /// String form. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RadioButton.cs
- HybridDictionary.cs
- CodePageEncoding.cs
- SafeProcessHandle.cs
- InlineCollection.cs
- SyndicationElementExtensionCollection.cs
- DataServiceClientException.cs
- DeclaredTypeValidator.cs
- StringSource.cs
- Comparer.cs
- GridViewItemAutomationPeer.cs
- Utils.cs
- FileEnumerator.cs
- RemotingSurrogateSelector.cs
- followingquery.cs
- WebConfigurationManager.cs
- SessionStateContainer.cs
- ChildDocumentBlock.cs
- Brushes.cs
- LocatorPart.cs
- UIElementParagraph.cs
- SqlWebEventProvider.cs
- CardSpaceException.cs
- LazyTextWriterCreator.cs
- LocalBuilder.cs
- LinkedList.cs
- SemaphoreFullException.cs
- StandardBindingImporter.cs
- SchemaImporterExtensionElementCollection.cs
- Ipv6Element.cs
- UiaCoreTypesApi.cs
- Transform3D.cs
- TextServicesContext.cs
- BitmapInitialize.cs
- _ScatterGatherBuffers.cs
- TrackingParticipant.cs
- HTTPNotFoundHandler.cs
- TextCollapsingProperties.cs
- SystemSounds.cs
- ScriptManager.cs
- SecureConversationServiceCredential.cs
- StrokeCollection2.cs
- RuleSettings.cs
- ValueSerializerAttribute.cs
- GraphicsPath.cs
- SpecialFolderEnumConverter.cs
- SignatureHelper.cs
- MethodCallConverter.cs
- CacheAxisQuery.cs
- ViewCellSlot.cs
- ConvertEvent.cs
- AssertSection.cs
- DoubleUtil.cs
- FileAuthorizationModule.cs
- OleDbPropertySetGuid.cs
- ProfileSettings.cs
- ScrollChangedEventArgs.cs
- Stream.cs
- KnownTypeAttribute.cs
- ValueTypeFixupInfo.cs
- TypeSystem.cs
- FormViewPagerRow.cs
- PersistChildrenAttribute.cs
- UIElementIsland.cs
- WebPartRestoreVerb.cs
- FixedHighlight.cs
- FileLogRecord.cs
- CqlQuery.cs
- StrokeNodeOperations.cs
- EventWaitHandle.cs
- DrawListViewSubItemEventArgs.cs
- KeyboardDevice.cs
- Point.cs
- _SslStream.cs
- ReferencedAssembly.cs
- HMACRIPEMD160.cs
- ToolboxItemCollection.cs
- CSharpCodeProvider.cs
- EncryptedXml.cs
- MasterPageParser.cs
- XPathQilFactory.cs
- ControlCollection.cs
- CodeIndexerExpression.cs
- XmlWhitespace.cs
- Point3DCollection.cs
- XmlElementAttributes.cs
- BulletChrome.cs
- CommonDialog.cs
- TraceEventCache.cs
- IgnoreDeviceFilterElementCollection.cs
- TiffBitmapEncoder.cs
- DatatypeImplementation.cs
- StrokeCollection.cs
- Triplet.cs
- PresentationAppDomainManager.cs
- PersonalizationState.cs
- NavigationEventArgs.cs
- DataGrid.cs
- FixedSOMImage.cs
- OrderPreservingPipeliningSpoolingTask.cs