Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Automation / Peers / DocumentPageViewAutomationPeer.cs / 1 / DocumentPageViewAutomationPeer.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: DocumentPageViewAutomationPeer.cs // // Description: AutomationPeer associated with DocumentPageView. // //--------------------------------------------------------------------------- using System.Collections.Generic; // Listusing System.Globalization; // CultureInfo using System.Windows.Controls; // DocumentViewer using System.Windows.Controls.Primitives; // DocumentPageView namespace System.Windows.Automation.Peers { /// /// AutomationPeer associated with DocumentPageView. /// public class DocumentPageViewAutomationPeer : FrameworkElementAutomationPeer { ////// Constructor. /// /// Owner of the AutomationPeer. public DocumentPageViewAutomationPeer(DocumentPageView owner) : base(owner) {} ////// ////// /// AutomationPeer associated with DocumentPageView blocks any exposure /// of the currently hosted page. So it returns empty collection of children. /// protected override ListGetChildrenCore() { return null; } /// /// ////// A string representing the current DocumentPageView. protected override string GetAutomationIdCore() { // Initialize the result to Empty, so that if Name is not set on the // DocumentPageView, and there is no valid PageNumber set, then the // AutomationId will remain blank to avoid duplicate entries. string result = string.Empty; DocumentPageView owner = (DocumentPageView)Owner; // Check if a Name is already set on the DocumentPageView, otherwise attempt // to construct one. if (!string.IsNullOrEmpty(owner.Name)) { result = owner.Name; } else if ((owner.PageNumber >= 0) && (owner.PageNumber < int.MaxValue)) { // This will set the AutomationId to a string that represents the current // page number, i.e. "DocumentPage1" will represent the first page. These numbers // will be kept in a 1-indexed format. InvariantCulture is used to ensure // that these AutomationIds will not change with the language, so that they // can be trusted to always work in automation. result = String.Format(CultureInfo.InvariantCulture, "DocumentPage{0}", owner.PageNumber + 1); } return result; } } } // 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
- Transform3D.cs
- ReliableMessagingVersion.cs
- PeerToPeerException.cs
- exports.cs
- NativeRightsManagementAPIsStructures.cs
- SByteStorage.cs
- Component.cs
- OlePropertyStructs.cs
- GeneralTransformGroup.cs
- XmlSchemaObjectCollection.cs
- SqlGatherConsumedAliases.cs
- SystemColors.cs
- MultiByteCodec.cs
- WebBrowserDocumentCompletedEventHandler.cs
- ContentPlaceHolder.cs
- ControlValuePropertyAttribute.cs
- AttributeData.cs
- MachineSettingsSection.cs
- ArrayTypeMismatchException.cs
- PasswordRecovery.cs
- SimpleHandlerBuildProvider.cs
- DashStyle.cs
- XmlElementList.cs
- ViewBox.cs
- SchemaImporterExtensionElementCollection.cs
- SelfIssuedAuthRSAPKCS1SignatureFormatter.cs
- DoubleLink.cs
- VoiceSynthesis.cs
- CheckBoxAutomationPeer.cs
- XmlAttributeProperties.cs
- BorderGapMaskConverter.cs
- RsaKeyIdentifierClause.cs
- XmlNamedNodeMap.cs
- HashCodeCombiner.cs
- AppSettingsReader.cs
- StateMachineTimers.cs
- MappingModelBuildProvider.cs
- LayoutSettings.cs
- controlskin.cs
- SignatureGenerator.cs
- _Events.cs
- ResourceAssociationTypeEnd.cs
- Attributes.cs
- DataKey.cs
- BufferedReadStream.cs
- XmlWriterTraceListener.cs
- ResourceContainer.cs
- MD5CryptoServiceProvider.cs
- MetadataCache.cs
- ParserOptions.cs
- RequestCacheValidator.cs
- KnownTypeHelper.cs
- RuleSetCollection.cs
- PartialCachingAttribute.cs
- ellipse.cs
- ResourceDisplayNameAttribute.cs
- ClosableStream.cs
- WebPartZoneBase.cs
- AssemblyNameProxy.cs
- ErrorTableItemStyle.cs
- DataSet.cs
- ColorPalette.cs
- _CommandStream.cs
- DocumentOrderQuery.cs
- XPathExpr.cs
- ChangesetResponse.cs
- ApplicationSettingsBase.cs
- DeclaredTypeValidatorAttribute.cs
- XamlToRtfWriter.cs
- HuffmanTree.cs
- TextBox.cs
- Matrix3D.cs
- DataGridViewCellMouseEventArgs.cs
- XmlChildEnumerator.cs
- TransportDefaults.cs
- HostingEnvironmentSection.cs
- SimpleLine.cs
- QilGenerator.cs
- ExpressionBindingCollection.cs
- ValidationHelper.cs
- ObjectAssociationEndMapping.cs
- CultureData.cs
- DataListItemCollection.cs
- ControlHelper.cs
- ProfileService.cs
- ObjectListField.cs
- System.Data_BID.cs
- DBDataPermission.cs
- Imaging.cs
- CriticalFinalizerObject.cs
- IResourceProvider.cs
- BinaryUtilClasses.cs
- DynamicPropertyReader.cs
- HttpRawResponse.cs
- FigureHelper.cs
- PropertyChangeTracker.cs
- XPathNavigatorReader.cs
- DictionaryGlobals.cs
- FloaterBaseParagraph.cs
- StringUtil.cs