Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / 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. //---------------------------------------------------------------------------- // // 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
- FocusChangedEventArgs.cs
- DependentTransaction.cs
- ServiceOperationParameter.cs
- SrgsText.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- FormatConvertedBitmap.cs
- GlyphElement.cs
- CanonicalizationDriver.cs
- AsyncContentLoadedEventArgs.cs
- XmlQueryCardinality.cs
- Wildcard.cs
- PageSetupDialog.cs
- CompilerErrorCollection.cs
- EncodingConverter.cs
- SystemFonts.cs
- XmlKeywords.cs
- PolicyUnit.cs
- WorkflowMarkupSerializationProvider.cs
- BinHexDecoder.cs
- WebPartMovingEventArgs.cs
- SplayTreeNode.cs
- CharEntityEncoderFallback.cs
- FormViewInsertedEventArgs.cs
- TaskFormBase.cs
- BmpBitmapEncoder.cs
- SchemaObjectWriter.cs
- MissingManifestResourceException.cs
- Ray3DHitTestResult.cs
- StylusPointPropertyInfoDefaults.cs
- CacheDependency.cs
- ItemCheckedEvent.cs
- RegionData.cs
- HtmlTableRow.cs
- COM2TypeInfoProcessor.cs
- X509Certificate2.cs
- MostlySingletonList.cs
- AutomationEventArgs.cs
- HighlightComponent.cs
- TextDocumentView.cs
- SmiEventSink_DeferedProcessing.cs
- CustomAttributeSerializer.cs
- ConfigXmlAttribute.cs
- ContainerParagraph.cs
- XmlUtilWriter.cs
- HashMembershipCondition.cs
- DeferrableContentConverter.cs
- StateDesigner.cs
- AppliedDeviceFiltersEditor.cs
- ValueUnavailableException.cs
- DataServiceQueryContinuation.cs
- TextElementCollection.cs
- HttpProfileGroupBase.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- configsystem.cs
- Int32AnimationUsingKeyFrames.cs
- InstanceLockedException.cs
- FixedSOMSemanticBox.cs
- NativeRightsManagementAPIsStructures.cs
- XamlLoadErrorInfo.cs
- CodeAttributeArgumentCollection.cs
- ChannelBinding.cs
- BitmapPalettes.cs
- VectorKeyFrameCollection.cs
- XmlElementAttributes.cs
- XmlSerializerAssemblyAttribute.cs
- OverloadGroupAttribute.cs
- SynchronizationLockException.cs
- FormViewCommandEventArgs.cs
- SqlTrackingWorkflowInstance.cs
- AutoResetEvent.cs
- EdmError.cs
- PageBuildProvider.cs
- ColumnCollection.cs
- XsdBuilder.cs
- StyleTypedPropertyAttribute.cs
- ThreadStaticAttribute.cs
- QueryPageSettingsEventArgs.cs
- GeneralTransform3DTo2DTo3D.cs
- IdentityReference.cs
- ZipPackage.cs
- WindowsTooltip.cs
- SchemaDeclBase.cs
- Substitution.cs
- GridViewColumn.cs
- DbProviderFactory.cs
- Pair.cs
- ButtonFieldBase.cs
- ActiveDocumentEvent.cs
- SettingsBindableAttribute.cs
- Polyline.cs
- CqlErrorHelper.cs
- KerberosTicketHashIdentifierClause.cs
- SmtpReplyReader.cs
- SocketElement.cs
- EntityDataSourceContainerNameItem.cs
- QueryContinueDragEventArgs.cs
- MatrixConverter.cs
- InvalidComObjectException.cs
- FileDialog_Vista.cs
- TypeResolvingOptions.cs