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
- LiteralSubsegment.cs
- UnionCodeGroup.cs
- SqlExpressionNullability.cs
- WebPartZone.cs
- EventDescriptorCollection.cs
- XmlRawWriter.cs
- RemotingConfigParser.cs
- COMException.cs
- Rect.cs
- _UriTypeConverter.cs
- DefaultBindingPropertyAttribute.cs
- DBBindings.cs
- XmlReader.cs
- InProcStateClientManager.cs
- HttpRuntimeSection.cs
- PingReply.cs
- SoapHttpTransportImporter.cs
- HostingEnvironmentException.cs
- AnnotationMap.cs
- BamlWriter.cs
- SecUtil.cs
- StreamMarshaler.cs
- SpellerHighlightLayer.cs
- ISCIIEncoding.cs
- RegistrationServices.cs
- PointLightBase.cs
- TabPage.cs
- KnownTypes.cs
- TypedElement.cs
- SecurityTokenResolver.cs
- ImageConverter.cs
- UserInitiatedNavigationPermission.cs
- DataTableReader.cs
- ClientBuildManager.cs
- MenuItemBinding.cs
- SystemIcmpV4Statistics.cs
- ObjectQueryExecutionPlan.cs
- ToolStripLabel.cs
- PropertyEntry.cs
- WCFBuildProvider.cs
- CompiledAction.cs
- RoleService.cs
- FieldBuilder.cs
- PhysicalFontFamily.cs
- Int64Converter.cs
- RefExpr.cs
- PasswordRecovery.cs
- Rotation3DAnimationUsingKeyFrames.cs
- ManipulationCompletedEventArgs.cs
- RetrieveVirtualItemEventArgs.cs
- StyleSheetComponentEditor.cs
- CodeDomConfigurationHandler.cs
- _CacheStreams.cs
- InternalTransaction.cs
- WinInet.cs
- RunInstallerAttribute.cs
- ConfigXmlAttribute.cs
- DataGridCaption.cs
- FontStyleConverter.cs
- DefaultValueTypeConverter.cs
- smtpconnection.cs
- GPStream.cs
- DeploymentSection.cs
- streamingZipPartStream.cs
- ComAdminWrapper.cs
- SqlMethodAttribute.cs
- SignerInfo.cs
- MD5.cs
- FormViewInsertedEventArgs.cs
- TimeoutException.cs
- RichTextBoxContextMenu.cs
- SchemaCollectionPreprocessor.cs
- TrackingProfileManager.cs
- AttributeParameterInfo.cs
- Zone.cs
- XmlQueryType.cs
- FormViewInsertEventArgs.cs
- DesignTimeTemplateParser.cs
- DataGridClipboardHelper.cs
- TreeViewDataItemAutomationPeer.cs
- CacheAxisQuery.cs
- LabelLiteral.cs
- CurrentTimeZone.cs
- DataPointer.cs
- UnsafeNativeMethods.cs
- TextContainerHelper.cs
- ListViewItemMouseHoverEvent.cs
- _Rfc2616CacheValidators.cs
- Native.cs
- AutoSizeToolBoxItem.cs
- CodeExpressionCollection.cs
- DataServiceQueryException.cs
- DataGridItemCollection.cs
- SortedList.cs
- NonValidatingSecurityTokenAuthenticator.cs
- FakeModelItemImpl.cs
- SynchronizedReadOnlyCollection.cs
- mda.cs
- Light.cs
- HtmlTableCellCollection.cs