Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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. // Copyright (c) Microsoft Corporation. All rights reserved./// 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
- WebBrowserEvent.cs
- LocalizableResourceBuilder.cs
- DbDeleteCommandTree.cs
- EmptyImpersonationContext.cs
- BitArray.cs
- PackageRelationshipCollection.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- TrustManager.cs
- MenuDesigner.cs
- ObjectQueryState.cs
- PersianCalendar.cs
- FigureParagraph.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- NameValueSectionHandler.cs
- WebPartExportVerb.cs
- PartialArray.cs
- SkipQueryOptionExpression.cs
- ImageSource.cs
- BitmapEncoder.cs
- InlineObject.cs
- DataObject.cs
- HtmlEncodedRawTextWriter.cs
- SqlVisitor.cs
- MappingModelBuildProvider.cs
- Compilation.cs
- HttpResponseBase.cs
- ScriptReference.cs
- MemoryPressure.cs
- SqlProviderServices.cs
- HtmlFormWrapper.cs
- Repeater.cs
- PasswordDeriveBytes.cs
- ReflectionHelper.cs
- AuthStoreRoleProvider.cs
- ResourceLoader.cs
- KeyConstraint.cs
- BigInt.cs
- ObservableCollection.cs
- EntityWithKeyStrategy.cs
- X509ScopedServiceCertificateElementCollection.cs
- CompilerInfo.cs
- DefaultTextStoreTextComposition.cs
- EnvelopeVersion.cs
- TimeSpan.cs
- HttpResponse.cs
- EnumBuilder.cs
- DbConnectionOptions.cs
- CachedCompositeFamily.cs
- DataGridViewAccessibleObject.cs
- SettingsPropertyValue.cs
- DropDownList.cs
- RecognitionResult.cs
- formatstringdialog.cs
- ImagingCache.cs
- XmlSchemaSequence.cs
- BinaryParser.cs
- XmlUnspecifiedAttribute.cs
- DataList.cs
- SqlUDTStorage.cs
- SpecularMaterial.cs
- SqlErrorCollection.cs
- GeometryDrawing.cs
- DispatcherEventArgs.cs
- ExtentKey.cs
- XmlSchemaValidationException.cs
- Control.cs
- WindowsToolbar.cs
- BitmapEffectDrawing.cs
- WebPartRestoreVerb.cs
- DayRenderEvent.cs
- DataTemplateSelector.cs
- ControlIdConverter.cs
- DefaultSection.cs
- PersonalizableTypeEntry.cs
- CmsInterop.cs
- DataSourceXmlSerializer.cs
- SingleConverter.cs
- UnsafeNativeMethods.cs
- ValueSerializerAttribute.cs
- Inflater.cs
- FileDataSourceCache.cs
- XmlQueryContext.cs
- StreamResourceInfo.cs
- HttpWebRequest.cs
- DesignOnlyAttribute.cs
- DataListItemCollection.cs
- FunctionUpdateCommand.cs
- WriteableOnDemandPackagePart.cs
- UnknownWrapper.cs
- StateWorkerRequest.cs
- XmlNamespaceManager.cs
- streamingZipPartStream.cs
- ClientEventManager.cs
- CalculatedColumn.cs
- Rfc2898DeriveBytes.cs
- FullTextLine.cs
- TabPanel.cs
- TransformPatternIdentifiers.cs
- ReadOnlyNameValueCollection.cs
- _NegoStream.cs