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
- TransformerInfo.cs
- FontDialog.cs
- FileBasedResourceGroveler.cs
- PolyBezierSegmentFigureLogic.cs
- SByteConverter.cs
- VisualTarget.cs
- HttpCachePolicyBase.cs
- ViewGenResults.cs
- CroppedBitmap.cs
- Fx.cs
- Light.cs
- FrameSecurityDescriptor.cs
- PopupRootAutomationPeer.cs
- Hash.cs
- RoleService.cs
- SqlClientFactory.cs
- DictionaryEditChange.cs
- ParameterCollection.cs
- RuntimeConfigLKG.cs
- DataGridViewRowsRemovedEventArgs.cs
- XmlAutoDetectWriter.cs
- EventRecordWrittenEventArgs.cs
- MethodBuilderInstantiation.cs
- Control.cs
- MemberPathMap.cs
- BooleanKeyFrameCollection.cs
- SoapException.cs
- DataViewSetting.cs
- XmlSchemaSimpleContentExtension.cs
- SEHException.cs
- WorkflowOperationAsyncResult.cs
- _FtpDataStream.cs
- Baml2006ReaderSettings.cs
- SectionInformation.cs
- ComponentEditorForm.cs
- ProcessStartInfo.cs
- FollowerQueueCreator.cs
- PlatformNotSupportedException.cs
- COM2TypeInfoProcessor.cs
- Buffer.cs
- GroupBox.cs
- NumberSubstitution.cs
- DefinitionUpdate.cs
- XmlCodeExporter.cs
- IteratorDescriptor.cs
- ControlParameter.cs
- SpecularMaterial.cs
- GCHandleCookieTable.cs
- NumericUpDownAccelerationCollection.cs
- WebPartCatalogAddVerb.cs
- FullTextState.cs
- AddInIpcChannel.cs
- TableRow.cs
- ClientBuildManagerCallback.cs
- RuntimeWrappedException.cs
- DeclarativeCatalogPart.cs
- TabPanel.cs
- XmlCountingReader.cs
- ReadOnlyCollection.cs
- ColorAnimation.cs
- FunctionImportMapping.cs
- PassportAuthenticationEventArgs.cs
- BinarySecretSecurityToken.cs
- SplitterDesigner.cs
- TransactionFlowProperty.cs
- ConnectorRouter.cs
- MexHttpsBindingCollectionElement.cs
- SourceChangedEventArgs.cs
- StatusBarPanelClickEvent.cs
- QuaternionConverter.cs
- XmlSchemaDatatype.cs
- SortExpressionBuilder.cs
- RawStylusActions.cs
- MyContact.cs
- HotCommands.cs
- Span.cs
- SamlSubjectStatement.cs
- XPathBuilder.cs
- SerializationEventsCache.cs
- HealthMonitoringSection.cs
- EmptyEnumerable.cs
- InvokeGenerator.cs
- StorageAssociationSetMapping.cs
- DataAdapter.cs
- WebRequestModuleElementCollection.cs
- SqlUDTStorage.cs
- MemberMaps.cs
- CollectionMarkupSerializer.cs
- SizeConverter.cs
- MultiPropertyDescriptorGridEntry.cs
- Int64AnimationBase.cs
- XmlAttributeAttribute.cs
- MemberProjectedSlot.cs
- ButtonStandardAdapter.cs
- SchemaDeclBase.cs
- IsolatedStorageSecurityState.cs
- ADMembershipProvider.cs
- TabletCollection.cs
- _FixedSizeReader.cs
- GPRECT.cs