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
- HMACSHA512.cs
- ModelFactory.cs
- SmiEventStream.cs
- GeneralTransform2DTo3D.cs
- Utils.cs
- FunctionImportElement.cs
- DefaultBindingPropertyAttribute.cs
- SiteOfOriginPart.cs
- SecurityRuntime.cs
- OleDbFactory.cs
- PriorityItem.cs
- BinaryFormatterWriter.cs
- ByteArrayHelperWithString.cs
- SurrogateSelector.cs
- ActivityLocationReferenceEnvironment.cs
- ServiceOperationWrapper.cs
- ExpressionEditor.cs
- embossbitmapeffect.cs
- XmlnsDefinitionAttribute.cs
- RsaSecurityToken.cs
- HtmlInputSubmit.cs
- StoreContentChangedEventArgs.cs
- ExpressionConverter.cs
- ItemList.cs
- GorillaCodec.cs
- OverflowException.cs
- ZoneLinkButton.cs
- IsolatedStorage.cs
- CodeBinaryOperatorExpression.cs
- WmlLiteralTextAdapter.cs
- BuildProviderUtils.cs
- EditorZoneBase.cs
- HostedTransportConfigurationBase.cs
- EncoderBestFitFallback.cs
- IpcManager.cs
- DataContractAttribute.cs
- StringAnimationBase.cs
- ToolTipAutomationPeer.cs
- NamespaceInfo.cs
- DatatypeImplementation.cs
- DesignBindingPicker.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- ImageClickEventArgs.cs
- DataContractSerializer.cs
- FileSystemWatcher.cs
- PbrsForward.cs
- FacetChecker.cs
- SchemaImporterExtension.cs
- RepeatBehaviorConverter.cs
- MouseActionConverter.cs
- DPCustomTypeDescriptor.cs
- ReflectionTypeLoadException.cs
- StringCollection.cs
- UserControlCodeDomTreeGenerator.cs
- XmlRootAttribute.cs
- WriteableBitmap.cs
- DbConnectionOptions.cs
- MessageSecurityVersion.cs
- WizardPanelChangingEventArgs.cs
- DocumentSequence.cs
- KerberosRequestorSecurityToken.cs
- ColumnMapCopier.cs
- SByteConverter.cs
- TemplatePropertyEntry.cs
- XPathNavigatorReader.cs
- XsltQilFactory.cs
- SynchronizingStream.cs
- ReadWriteObjectLock.cs
- TrackingServices.cs
- CryptoProvider.cs
- ResourceProviderFactory.cs
- DataSourceConverter.cs
- XmlSignificantWhitespace.cs
- AlgoModule.cs
- oledbmetadatacollectionnames.cs
- PermissionToken.cs
- DbDataSourceEnumerator.cs
- DesignerActionListCollection.cs
- ScalarConstant.cs
- WorkflowValidationFailedException.cs
- EventLogReader.cs
- WindowsStatusBar.cs
- File.cs
- SelectedGridItemChangedEvent.cs
- XmlDataImplementation.cs
- PolyBezierSegment.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- PrintDocument.cs
- ReflectTypeDescriptionProvider.cs
- ActiveDocumentEvent.cs
- PartBasedPackageProperties.cs
- ProfileManager.cs
- JournalNavigationScope.cs
- PageVisual.cs
- TabPage.cs
- PixelFormats.cs
- AccessText.cs
- DataPointer.cs
- ManagedIStream.cs
- CmsUtils.cs