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
- NotSupportedException.cs
- OpacityConverter.cs
- SQlBooleanStorage.cs
- DBNull.cs
- ComponentRenameEvent.cs
- CodeFieldReferenceExpression.cs
- UnmanagedBitmapWrapper.cs
- InvalidAsynchronousStateException.cs
- odbcmetadatacolumnnames.cs
- UnsafeNativeMethods.cs
- EntityObject.cs
- UIElementCollection.cs
- DataRowCollection.cs
- ContextStaticAttribute.cs
- CompilerErrorCollection.cs
- HttpContext.cs
- Module.cs
- StrongBox.cs
- DataKeyCollection.cs
- SchemaComplexType.cs
- TemplatedMailWebEventProvider.cs
- InheritanceContextChangedEventManager.cs
- JsonStringDataContract.cs
- SqlTrackingWorkflowInstance.cs
- PathFigure.cs
- Icon.cs
- TreeNodeStyle.cs
- WindowClosedEventArgs.cs
- ApplicationFileParser.cs
- LinqDataSourceHelper.cs
- LockCookie.cs
- EmptyStringExpandableObjectConverter.cs
- EncoderFallback.cs
- FixedSOMTableRow.cs
- StylusPointDescription.cs
- XmlEncodedRawTextWriter.cs
- Vector3D.cs
- EditingScopeUndoUnit.cs
- TemplateXamlTreeBuilder.cs
- XmlSchemaCompilationSettings.cs
- GlobalEventManager.cs
- ByteStreamBufferedMessageData.cs
- SharedMemory.cs
- DesignerTransactionCloseEvent.cs
- FixedTextSelectionProcessor.cs
- OdbcConnectionHandle.cs
- GenericWebPart.cs
- ValidationErrorCollection.cs
- ComponentConverter.cs
- MessageDroppedTraceRecord.cs
- TypeInfo.cs
- XmlDataDocument.cs
- IndexedString.cs
- ExtenderProviderService.cs
- Base64Encoder.cs
- Symbol.cs
- Pair.cs
- DropShadowBitmapEffect.cs
- ClientScriptManagerWrapper.cs
- WpfKnownMember.cs
- TextTreeTextNode.cs
- TextFormatterImp.cs
- CommentEmitter.cs
- AmbiguousMatchException.cs
- ActivityCodeDomReferenceService.cs
- ColorAnimation.cs
- Unit.cs
- SQLInt32Storage.cs
- TimeSpanConverter.cs
- CodeGenerator.cs
- safex509handles.cs
- BitmapEffectGroup.cs
- CharacterShapingProperties.cs
- RayMeshGeometry3DHitTestResult.cs
- BlockUIContainer.cs
- Pointer.cs
- ADMembershipProvider.cs
- FactoryGenerator.cs
- SapiAttributeParser.cs
- TemplateControlBuildProvider.cs
- SqlDataSourceView.cs
- CustomCategoryAttribute.cs
- ParamArrayAttribute.cs
- BaseCollection.cs
- WmlObjectListAdapter.cs
- XPathNodeHelper.cs
- TokenizerHelper.cs
- SortedSetDebugView.cs
- NetCodeGroup.cs
- ConfigurationManagerHelper.cs
- ImageFormat.cs
- GenerateDerivedKeyRequest.cs
- Icon.cs
- BitmapDecoder.cs
- IconHelper.cs
- WebErrorHandler.cs
- SafeUserTokenHandle.cs
- FormViewUpdateEventArgs.cs
- GeneralTransform3DTo2DTo3D.cs
- MultilineStringConverter.cs