Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / DocumentPageViewAutomationPeer.cs / 1305600 / 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
- PropertyDescriptorComparer.cs
- Rule.cs
- PageTheme.cs
- FileSystemInfo.cs
- MULTI_QI.cs
- DbMetaDataColumnNames.cs
- FrameSecurityDescriptor.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- MulticastIPAddressInformationCollection.cs
- TextAdaptor.cs
- ObjectSelectorEditor.cs
- CommandManager.cs
- _NegotiateClient.cs
- SchemaMapping.cs
- BasicBrowserDialog.designer.cs
- CodeAccessPermission.cs
- QilName.cs
- Control.cs
- StrongNamePublicKeyBlob.cs
- WebZone.cs
- ResolvedKeyFrameEntry.cs
- Utilities.cs
- QueryOpeningEnumerator.cs
- HostedBindingBehavior.cs
- TriggerActionCollection.cs
- _SSPISessionCache.cs
- UserControl.cs
- NavigationPropertyEmitter.cs
- ScrollData.cs
- AssociationSet.cs
- XhtmlBasicTextBoxAdapter.cs
- FixedHighlight.cs
- WebPartCancelEventArgs.cs
- XamlParser.cs
- PersonalizationState.cs
- PeerObject.cs
- WorkflowDurableInstance.cs
- SchemaMerger.cs
- CachedCompositeFamily.cs
- DesignerActionVerbItem.cs
- TdsParserStateObject.cs
- LocatorBase.cs
- TableLayout.cs
- CheckBox.cs
- SubqueryRules.cs
- ItemsPresenter.cs
- CellCreator.cs
- URI.cs
- EncoderReplacementFallback.cs
- ImageCreator.cs
- LineMetrics.cs
- ISCIIEncoding.cs
- RowSpanVector.cs
- ToolStripLocationCancelEventArgs.cs
- Win32KeyboardDevice.cs
- WebPartConnectionsDisconnectVerb.cs
- LayoutUtils.cs
- RemoveStoryboard.cs
- MatrixValueSerializer.cs
- WebPartConnection.cs
- ConnectionProviderAttribute.cs
- CodeDomSerializationProvider.cs
- DbTypeMap.cs
- ISAPIApplicationHost.cs
- AbsoluteQuery.cs
- PerformanceCounterNameAttribute.cs
- DatagridviewDisplayedBandsData.cs
- CalendarDateRangeChangingEventArgs.cs
- DesignerActionHeaderItem.cs
- StreamResourceInfo.cs
- CopyAttributesAction.cs
- XmlHierarchicalEnumerable.cs
- Message.cs
- StateMachine.cs
- ChtmlSelectionListAdapter.cs
- UnsafeNativeMethods.cs
- XmlEntityReference.cs
- SQLSingle.cs
- OleDbSchemaGuid.cs
- LogExtent.cs
- Stacktrace.cs
- AttachedAnnotationChangedEventArgs.cs
- BaseServiceProvider.cs
- XmlNodeList.cs
- NegotiateStream.cs
- TextEffect.cs
- SqlMethods.cs
- HtmlLink.cs
- SecurityManager.cs
- FileUtil.cs
- CopyCodeAction.cs
- entityreference_tresulttype.cs
- GeneralTransform3DGroup.cs
- UshortList2.cs
- Panel.cs
- ConfigXmlWhitespace.cs
- StructuredProperty.cs
- safex509handles.cs
- wgx_sdk_version.cs
- SchemaNames.cs