Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Print / Reach / PrintConfig / JobInputBins.cs / 1 / JobInputBins.cs
/*++ Copyright (C) 2005 Microsoft Corporation All rights reserved. Module Name: JobInputBins.cs Abstract: Definition and implementation of this public feature/parameter related types. Author: [....] ([....]) 6/10/2005 --*/ using System; using System.IO; using System.Xml; using System.Collections; using System.Collections.ObjectModel; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Printing; using MS.Internal.Printing.Configuration; namespace MS.Internal.Printing.Configuration { ////// Represents an input bin option. /// internal class InputBinOption: PrintCapabilityOption { #region Constructors internal InputBinOption(PrintCapabilityFeature ownerFeature) : base(ownerFeature) { _value = 0; } #endregion Constructors #region Public Properties ////// Gets the input bin's value. /// public InputBin Value { get { return _value; } } #endregion Public Properties #region Public Methods ////// Converts the input bin to human-readable string. /// ///A string that represents this input bin. public override string ToString() { return Value.ToString(); } #endregion Public Methods #region Internal Fields internal InputBin _value; #endregion Internal Fields } ////// Represents input bin capability. /// abstract internal class InputBinCapability : PrintCapabilityFeature { #region Constructors internal InputBinCapability(InternalPrintCapabilities ownerPrintCap) : base(ownerPrintCap) { } #endregion Constructors #region Public Properties ////// Gets the collection object that represents input bins supported by the device. /// public CollectionInputBins { get { return _inputBins; } } #endregion Public Properties #region Internal Methods internal override sealed bool AddOptionCallback(PrintCapabilityOption baseOption) { bool added = false; InputBinOption option = baseOption as InputBinOption; // Validate the option is complete before adding it to the collection if (option._optionName != null) { int enumValue = PrintSchemaMapper.SchemaNameToEnumValueWithArray( PrintSchemaTags.Keywords.InputBinKeys.InputBinNames, PrintSchemaTags.Keywords.InputBinKeys.InputBinEnums, option._optionName); if (enumValue > 0) { // We require the InputBin option to have an option name option._value = (InputBin)enumValue; this.InputBins.Add(option); added = true; } } return added; } internal override sealed void AddSubFeatureCallback(PrintCapabilityFeature subFeature) { // no sub-feature } internal override sealed bool FeaturePropCallback(PrintCapabilityFeature feature, XmlPrintCapReader reader) { // no feature property to handle return false; } internal override sealed PrintCapabilityOption NewOptionCallback(PrintCapabilityFeature baseFeature) { InputBinOption option = new InputBinOption(baseFeature); return option; } internal override sealed void OptionAttrCallback(PrintCapabilityOption baseOption, XmlPrintCapReader reader) { // no option attribute to handle return; } /// XML is not well-formed. internal override sealed bool OptionPropCallback(PrintCapabilityOption baseOption, XmlPrintCapReader reader) { // no option property to handle return false; } #endregion Internal Methods #region Internal Properties internal override sealed bool IsValid { get { return (this.InputBins.Count > 0); } } internal abstract override string FeatureName { get; } internal override sealed bool HasSubFeature { get { return false; } } #endregion Internal Properties #region Internal Fields internal Collection_inputBins; #endregion Internal Fields } /// /// Represents job input bin capability. /// internal class JobInputBinCapability : InputBinCapability { #region Constructors internal JobInputBinCapability(InternalPrintCapabilities ownerPrintCap) : base(ownerPrintCap) { } #endregion Constructors #region Internal Methods internal static PrintCapabilityFeature NewFeatureCallback(InternalPrintCapabilities printCap) { JobInputBinCapability cap = new JobInputBinCapability(printCap); cap._inputBins = new Collection(); return cap; } #endregion Internal Methods #region Internal Properties internal override sealed string FeatureName { get { return PrintSchemaTags.Keywords.InputBinKeys.JobInputBin; } } #endregion Internal Properties } /// /// Represents document input bin capability. /// internal class DocumentInputBinCapability : InputBinCapability { #region Constructors internal DocumentInputBinCapability(InternalPrintCapabilities ownerPrintCap) : base(ownerPrintCap) { } #endregion Constructors #region Internal Methods internal static PrintCapabilityFeature NewFeatureCallback(InternalPrintCapabilities printCap) { DocumentInputBinCapability cap = new DocumentInputBinCapability(printCap); cap._inputBins = new Collection(); return cap; } #endregion Internal Methods #region Internal Properties internal override sealed string FeatureName { get { return PrintSchemaTags.Keywords.InputBinKeys.DocumentInputBin; } } #endregion Internal Properties } /// /// Represents page input bin capability. /// internal class PageInputBinCapability : InputBinCapability { #region Constructors internal PageInputBinCapability(InternalPrintCapabilities ownerPrintCap) : base(ownerPrintCap) { } #endregion Constructors #region Internal Methods internal static PrintCapabilityFeature NewFeatureCallback(InternalPrintCapabilities printCap) { PageInputBinCapability cap = new PageInputBinCapability(printCap); cap._inputBins = new Collection(); return cap; } #endregion Internal Methods #region Internal Properties internal override sealed string FeatureName { get { return PrintSchemaTags.Keywords.InputBinKeys.PageInputBin; } } #endregion Internal Properties } /// /// Represents input bin setting. /// abstract internal class InputBinSetting : PrintTicketFeature { #region Constructors ////// Constructs a new input bin setting object. /// internal InputBinSetting(InternalPrintTicket ownerPrintTicket, string featureName) : base(ownerPrintTicket) { this._featureName = featureName; this._propertyMaps = new PTPropertyMapEntry[] { new PTPropertyMapEntry(this, PrintSchemaTags.Framework.OptionNameProperty, PTPropValueTypes.EnumStringValue, PrintSchemaTags.Keywords.InputBinKeys.InputBinNames, PrintSchemaTags.Keywords.InputBinKeys.InputBinEnums), }; } #endregion Constructors #region Public Properties ////// Gets or sets the input bin setting's value. /// ////// If the setting is not specified yet, getter will return 0. /// ////// The value to set is not one of the standard public InputBin Value { get { return (InputBin)this[PrintSchemaTags.Framework.OptionNameProperty]; } set { if (value < PrintSchema.InputBinEnumMin || value > PrintSchema.InputBinEnumMax) { throw new ArgumentOutOfRangeException("value"); } this[PrintSchemaTags.Framework.OptionNameProperty] = (int)value; } } #endregion Public Properties #region Public Methods ///. /// /// Converts the input bin setting to human-readable string. /// ///A string that represents this input bin setting. public override string ToString() { return Value.ToString(); } #endregion Public Methods } ////// Represents job input bin setting. /// internal class JobInputBinSetting : InputBinSetting { #region Constructors internal JobInputBinSetting(InternalPrintTicket ownerPrintTicket) : base(ownerPrintTicket, PrintSchemaTags.Keywords.InputBinKeys.JobInputBin) { } #endregion Constructors } ////// Represents document input bin setting. /// internal class DocumentInputBinSetting : InputBinSetting { #region Constructors internal DocumentInputBinSetting(InternalPrintTicket ownerPrintTicket) : base(ownerPrintTicket, PrintSchemaTags.Keywords.InputBinKeys.DocumentInputBin) { } #endregion Constructors } ////// Represents page input bin setting. /// internal class PageInputBinSetting : InputBinSetting { #region Constructors internal PageInputBinSetting(InternalPrintTicket ownerPrintTicket) : base(ownerPrintTicket, PrintSchemaTags.Keywords.InputBinKeys.PageInputBin) { } #endregion Constructors } } // 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
- ObjectHandle.cs
- PageAsyncTaskManager.cs
- FormatException.cs
- CipherData.cs
- NavigationCommands.cs
- TextRunTypographyProperties.cs
- QuadraticBezierSegment.cs
- XmlSchemaObjectTable.cs
- _NetRes.cs
- SoundPlayerAction.cs
- MasterPageCodeDomTreeGenerator.cs
- HtmlTableRow.cs
- ClientSponsor.cs
- NativeRightsManagementAPIsStructures.cs
- SimpleRecyclingCache.cs
- UnicodeEncoding.cs
- SortQuery.cs
- UnitControl.cs
- MaskedTextBoxTextEditorDropDown.cs
- BaseContextMenu.cs
- CustomSignedXml.cs
- QuaternionKeyFrameCollection.cs
- DataFormat.cs
- DeflateEmulationStream.cs
- Message.cs
- SystemFonts.cs
- ContentAlignmentEditor.cs
- ExpressionBuilderCollection.cs
- FlowDocument.cs
- SiteMapHierarchicalDataSourceView.cs
- IndexerNameAttribute.cs
- PassportAuthenticationModule.cs
- GridProviderWrapper.cs
- ResumeStoryboard.cs
- WebServiceEnumData.cs
- FixedPageProcessor.cs
- PropertySourceInfo.cs
- ChangeConflicts.cs
- StateBag.cs
- SerializationTrace.cs
- OptimalBreakSession.cs
- UiaCoreProviderApi.cs
- ShutDownListener.cs
- MembershipValidatePasswordEventArgs.cs
- QueryOutputWriter.cs
- SelfIssuedSamlTokenFactory.cs
- SubclassTypeValidator.cs
- SqlMethodTransformer.cs
- IssuedTokensHeader.cs
- XmlDataSource.cs
- GridItemPatternIdentifiers.cs
- QuadTree.cs
- DataGridViewTextBoxCell.cs
- ComboBox.cs
- Comparer.cs
- validation.cs
- PropertyChange.cs
- StartUpEventArgs.cs
- ObjectSet.cs
- FileDialog_Vista.cs
- BinaryWriter.cs
- Keyboard.cs
- PrintControllerWithStatusDialog.cs
- MdiWindowListStrip.cs
- CodeDOMUtility.cs
- DbProviderSpecificTypePropertyAttribute.cs
- BaseCollection.cs
- MatrixAnimationUsingKeyFrames.cs
- DomainConstraint.cs
- DependencySource.cs
- AxHost.cs
- SystemKeyConverter.cs
- _OSSOCK.cs
- TemplateControlParser.cs
- DbCommandTree.cs
- SafeMILHandle.cs
- XmlDictionaryReader.cs
- TextFormatter.cs
- ComboBoxAutomationPeer.cs
- InheritanceRules.cs
- ListView.cs
- TemplateXamlTreeBuilder.cs
- ListBindingConverter.cs
- SerializerDescriptor.cs
- TemplateContent.cs
- XPathSelectionIterator.cs
- XmlQueryStaticData.cs
- xsdvalidator.cs
- MemberListBinding.cs
- CompilerErrorCollection.cs
- BrowserDefinitionCollection.cs
- Formatter.cs
- XPathQilFactory.cs
- ProjectionCamera.cs
- SqlMethodCallConverter.cs
- RemoteEndpointMessageProperty.cs
- ImageAttributes.cs
- Margins.cs
- DependentList.cs
- CompositeScriptReference.cs