Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- WindowsFormsHost.cs
- BitmapEffectInputData.cs
- Function.cs
- ListView.cs
- HtmlInputButton.cs
- ActiveXSite.cs
- InternalDuplexChannelFactory.cs
- DWriteFactory.cs
- XmlMembersMapping.cs
- NetMsmqBinding.cs
- Parameter.cs
- Light.cs
- ClientSettings.cs
- XmlSchemaDatatype.cs
- NominalTypeEliminator.cs
- CmsInterop.cs
- Evaluator.cs
- SourceLineInfo.cs
- ApplicationFileCodeDomTreeGenerator.cs
- NamespaceDisplayAutomationPeer.cs
- TextViewBase.cs
- UInt32Converter.cs
- ReflectionUtil.cs
- SqlDataSource.cs
- FocusTracker.cs
- MetadataArtifactLoaderCompositeFile.cs
- DataObjectEventArgs.cs
- EventEntry.cs
- EntitySqlException.cs
- ListItemsPage.cs
- ObjectListCommandsPage.cs
- RijndaelManaged.cs
- ShapingEngine.cs
- DiagnosticTrace.cs
- DATA_BLOB.cs
- SqlServices.cs
- CodeConditionStatement.cs
- SqlFlattener.cs
- Verify.cs
- UpdatePanelControlTrigger.cs
- uribuilder.cs
- StringUtil.cs
- SafeProcessHandle.cs
- MailAddressCollection.cs
- EvidenceBase.cs
- SafeFileMapViewHandle.cs
- QilXmlReader.cs
- ChangeTracker.cs
- Error.cs
- MultiSelector.cs
- GeneralTransform3DGroup.cs
- EdmProperty.cs
- unitconverter.cs
- Decimal.cs
- Trace.cs
- CalculatedColumn.cs
- DeliveryRequirementsAttribute.cs
- Int16AnimationBase.cs
- RowToParametersTransformer.cs
- HttpDictionary.cs
- TemplatePagerField.cs
- XXXOnTypeBuilderInstantiation.cs
- InputEventArgs.cs
- QueueTransferProtocol.cs
- IfAction.cs
- CorrelationExtension.cs
- ApplicationCommands.cs
- InternalTypeHelper.cs
- Point3DCollection.cs
- FormViewRow.cs
- SqlNamer.cs
- SiteMapDataSourceView.cs
- ObjectDataSourceView.cs
- StylusButtonCollection.cs
- ThrowHelper.cs
- ProviderConnectionPointCollection.cs
- DescendentsWalker.cs
- BindingCompleteEventArgs.cs
- DefaultObjectMappingItemCollection.cs
- ObjectList.cs
- HtmlTableRowCollection.cs
- SerializationInfo.cs
- StringWriter.cs
- HttpModuleCollection.cs
- RoutedPropertyChangedEventArgs.cs
- MsmqInputSessionChannel.cs
- CustomAttributeBuilder.cs
- Help.cs
- TextParagraphCache.cs
- LineServicesCallbacks.cs
- CryptoApi.cs
- MessageQueuePermissionEntryCollection.cs
- ScriptManagerProxy.cs
- SoapBinding.cs
- Debug.cs
- CodeTypeDeclaration.cs
- MenuEventArgs.cs
- FixedTextPointer.cs
- SoapReflectionImporter.cs
- EncoderReplacementFallback.cs