Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / Automation / Peers / DocumentViewerAutomationPeer.cs / 1 / DocumentViewerAutomationPeer.cs
using System; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Documents; using System.Windows.Interop; using System.Windows.Media; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { ////// AutomationPeer associated with DocumentViewer /// public class DocumentViewerAutomationPeer : DocumentViewerBaseAutomationPeer { ////// Constructor /// /// Owner of the AutomationPeer. public DocumentViewerAutomationPeer(DocumentViewer owner) : base(owner) { } ////// override protected string GetClassNameCore() { return "DocumentViewer"; } ////// /// override public object GetPattern(PatternInterface patternInterface) { object returnValue = null; // Check if provided patternInterface is for Scroll, which is all // that is currently exposed. if (patternInterface == PatternInterface.Scroll) { // Get a reference to DocumentViewer's ScrollViewer DocumentViewer owner = (DocumentViewer)Owner; if (owner.ScrollViewer != null) { // Get a reference to ScrollViewer's AutomationPeer. AutomationPeer scrollPeer = UIElementAutomationPeer.CreatePeerForElement(owner.ScrollViewer); if (scrollPeer != null && scrollPeer is IScrollProvider) { scrollPeer.EventsSource = this; returnValue = scrollPeer; } } } else { returnValue = base.GetPattern(patternInterface); } return returnValue; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Documents; using System.Windows.Interop; using System.Windows.Media; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { ////// /// AutomationPeer associated with DocumentViewer /// public class DocumentViewerAutomationPeer : DocumentViewerBaseAutomationPeer { ////// Constructor /// /// Owner of the AutomationPeer. public DocumentViewerAutomationPeer(DocumentViewer owner) : base(owner) { } ////// override protected string GetClassNameCore() { return "DocumentViewer"; } ////// /// override public object GetPattern(PatternInterface patternInterface) { object returnValue = null; // Check if provided patternInterface is for Scroll, which is all // that is currently exposed. if (patternInterface == PatternInterface.Scroll) { // Get a reference to DocumentViewer's ScrollViewer DocumentViewer owner = (DocumentViewer)Owner; if (owner.ScrollViewer != null) { // Get a reference to ScrollViewer's AutomationPeer. AutomationPeer scrollPeer = UIElementAutomationPeer.CreatePeerForElement(owner.ScrollViewer); if (scrollPeer != null && scrollPeer is IScrollProvider) { scrollPeer.EventsSource = this; returnValue = scrollPeer; } } } else { returnValue = base.GetPattern(patternInterface); } return returnValue; } } } // 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
- ReadOnlyCollectionBase.cs
- DragEvent.cs
- Update.cs
- TraceFilter.cs
- xsdvalidator.cs
- PingReply.cs
- MeshGeometry3D.cs
- ProcessModuleCollection.cs
- KeyPullup.cs
- ObjectDisposedException.cs
- X509SecurityToken.cs
- XamlVector3DCollectionSerializer.cs
- BuildResult.cs
- EFTableProvider.cs
- ExpressionEditorAttribute.cs
- connectionpool.cs
- FieldValue.cs
- ComPlusTypeValidator.cs
- RootBrowserWindow.cs
- FactoryRecord.cs
- Parser.cs
- TdsParser.cs
- SystemColorTracker.cs
- COM2PictureConverter.cs
- HttpProtocolReflector.cs
- DataServicePagingProviderWrapper.cs
- PersonalizationProviderHelper.cs
- TimerExtension.cs
- DataGridParentRows.cs
- DBSchemaTable.cs
- ConfigurationManager.cs
- cache.cs
- ResourceAssociationSet.cs
- RawTextInputReport.cs
- StreamResourceInfo.cs
- FolderBrowserDialog.cs
- SchemaTypeEmitter.cs
- cookiecollection.cs
- X509Certificate.cs
- TextDecorationCollection.cs
- DateTimeFormat.cs
- XmlBinaryWriterSession.cs
- CacheSection.cs
- TransformationRules.cs
- SoapTypeAttribute.cs
- DependencyPropertyHelper.cs
- SqlDeflator.cs
- QilLoop.cs
- MultiDataTrigger.cs
- securestring.cs
- CacheMemory.cs
- BatchWriter.cs
- Window.cs
- StatusBarItem.cs
- QuotedStringWriteStateInfo.cs
- StylusButtonCollection.cs
- TransactionManagerProxy.cs
- QilInvoke.cs
- MetaForeignKeyColumn.cs
- GraphicsContext.cs
- DataColumn.cs
- DbExpressionVisitor_TResultType.cs
- ZipIOFileItemStream.cs
- WpfKnownMember.cs
- GroupBox.cs
- AnnotationResource.cs
- PersonalizationProvider.cs
- InnerItemCollectionView.cs
- ScriptDescriptor.cs
- InlinedAggregationOperatorEnumerator.cs
- KernelTypeValidation.cs
- DataGridComponentEditor.cs
- ResponseStream.cs
- XmlStreamStore.cs
- RegisteredHiddenField.cs
- COM2ComponentEditor.cs
- SystemInformation.cs
- SqlUtils.cs
- SignatureToken.cs
- InternalControlCollection.cs
- NonParentingControl.cs
- XmlFormatMapping.cs
- Ipv6Element.cs
- CryptoHelper.cs
- IgnoreSection.cs
- ContentDisposition.cs
- ContentFilePart.cs
- CheckedListBox.cs
- XslNumber.cs
- MemoryResponseElement.cs
- MissingManifestResourceException.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- DefaultShape.cs
- LinqExpressionNormalizer.cs
- Translator.cs
- Point4DConverter.cs
- ViewBase.cs
- _RequestCacheProtocol.cs
- HttpValueCollection.cs
- Overlapped.cs