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
- ErrorInfoXmlDocument.cs
- TextSpan.cs
- IsolatedStorageFileStream.cs
- Container.cs
- AssemblyFilter.cs
- BitmapEffectInput.cs
- CharAnimationUsingKeyFrames.cs
- EDesignUtil.cs
- XPathExpr.cs
- AttachedPropertyMethodSelector.cs
- ListViewGroupItemCollection.cs
- QilLiteral.cs
- IsolatedStorageFilePermission.cs
- X509Certificate2.cs
- EntityDataSourceQueryBuilder.cs
- GrowingArray.cs
- FormatException.cs
- WebPartEditVerb.cs
- ValidationErrorEventArgs.cs
- AsyncResult.cs
- NetworkInformationPermission.cs
- OleDbMetaDataFactory.cs
- WorkflowInstanceExtensionManager.cs
- NameValuePair.cs
- LoadRetryAsyncResult.cs
- SQLByte.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs
- ShortcutKeysEditor.cs
- WebPartUserCapability.cs
- RequestCacheEntry.cs
- XmlSiteMapProvider.cs
- TemplateParser.cs
- ListItemDetailViewAttribute.cs
- ThreadPool.cs
- DataGridViewCellStyleConverter.cs
- MultidimensionalArrayItemReference.cs
- Int32Converter.cs
- PointCollectionValueSerializer.cs
- EntityDataSourceContainerNameConverter.cs
- Color.cs
- MethodAccessException.cs
- XamlWriter.cs
- CommonEndpointBehaviorElement.cs
- _OSSOCK.cs
- CodeConditionStatement.cs
- EditorPartCollection.cs
- IsolatedStorageFilePermission.cs
- MiniCustomAttributeInfo.cs
- TextEffect.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- CustomWebEventKey.cs
- _CookieModule.cs
- FastPropertyAccessor.cs
- WmfPlaceableFileHeader.cs
- _SafeNetHandles.cs
- TextProperties.cs
- ImmutableObjectAttribute.cs
- VisualBrush.cs
- SpellerStatusTable.cs
- DataGridViewBand.cs
- NullRuntimeConfig.cs
- ActivityCollectionMarkupSerializer.cs
- RequestQueryParser.cs
- ApplicationInterop.cs
- XmlArrayAttribute.cs
- XmlCountingReader.cs
- SqlMethodAttribute.cs
- DataGridCommandEventArgs.cs
- XhtmlBasicCalendarAdapter.cs
- DynamicMetaObjectBinder.cs
- ByteFacetDescriptionElement.cs
- FormsIdentity.cs
- WebSysDisplayNameAttribute.cs
- SharedStatics.cs
- BamlWriter.cs
- LocatorPartList.cs
- Label.cs
- ChangeBlockUndoRecord.cs
- SessionState.cs
- ActivationArguments.cs
- AssemblyUtil.cs
- IriParsingElement.cs
- GenericIdentity.cs
- BitmapEffectGeneralTransform.cs
- AsyncContentLoadedEventArgs.cs
- AssemblyInfo.cs
- RequiredFieldValidator.cs
- CellIdBoolean.cs
- DataRecord.cs
- SyndicationSerializer.cs
- CompiledQueryCacheKey.cs
- BuildProviderUtils.cs
- ConnectionStringEditor.cs
- OutOfMemoryException.cs
- SSmlParser.cs
- TypedTableBaseExtensions.cs
- SecurityTokenValidationException.cs
- ClientSideProviderDescription.cs
- CacheSection.cs
- PermissionListSet.cs