Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Automation / Peers / HwndHostAutomationPeer.cs / 1 / HwndHostAutomationPeer.cs
using System.Collections.Generic; using System.Windows.Automation; using System.Windows.Automation.Provider; using System.Windows.Interop; using System.Security; using System.Security.Permissions; using MS.Internal.Automation; namespace System.Windows.Automation.Peers { /// internal class HwndHostAutomationPeer : FrameworkElementAutomationPeer { /// public HwndHostAutomationPeer(HwndHost owner): base(owner) { IsInteropPeer = true; } /// override protected string GetClassNameCore() { return "HwndHost"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Pane; } ////// Critical - Calls critical HwndHost.CriticalHandle. /// TreatAsSafe - Critical data is used internally and not explosed /// [SecurityCritical, SecurityTreatAsSafe] override internal InteropAutomationProvider GetInteropChild() { if (_interopProvider == null) { HostedWindowWrapper wrapper = null; HwndHost host = (HwndHost)Owner; IntPtr hwnd = host.CriticalHandle; if(hwnd != IntPtr.Zero) { wrapper = HostedWindowWrapper.CreateInternal(hwnd); } _interopProvider = new InteropAutomationProvider(wrapper, this); } return _interopProvider; } #region Data private InteropAutomationProvider _interopProvider; #endregion Data } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System.Collections.Generic; using System.Windows.Automation; using System.Windows.Automation.Provider; using System.Windows.Interop; using System.Security; using System.Security.Permissions; using MS.Internal.Automation; namespace System.Windows.Automation.Peers { /// internal class HwndHostAutomationPeer : FrameworkElementAutomationPeer { /// public HwndHostAutomationPeer(HwndHost owner): base(owner) { IsInteropPeer = true; } /// override protected string GetClassNameCore() { return "HwndHost"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Pane; } ////// Critical - Calls critical HwndHost.CriticalHandle. /// TreatAsSafe - Critical data is used internally and not explosed /// [SecurityCritical, SecurityTreatAsSafe] override internal InteropAutomationProvider GetInteropChild() { if (_interopProvider == null) { HostedWindowWrapper wrapper = null; HwndHost host = (HwndHost)Owner; IntPtr hwnd = host.CriticalHandle; if(hwnd != IntPtr.Zero) { wrapper = HostedWindowWrapper.CreateInternal(hwnd); } _interopProvider = new InteropAutomationProvider(wrapper, this); } return _interopProvider; } #region Data private InteropAutomationProvider _interopProvider; #endregion Data } } // 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
- DrawingGroup.cs
- Compress.cs
- InvokeGenerator.cs
- XmlUnspecifiedAttribute.cs
- ConnectionPoolManager.cs
- LocalTransaction.cs
- SecurityTokenRequirement.cs
- NamespaceDecl.cs
- SQLInt32.cs
- XsltContext.cs
- EditorZoneBase.cs
- KeyedHashAlgorithm.cs
- LinqDataSourceInsertEventArgs.cs
- CodeDirectionExpression.cs
- CompressStream.cs
- ObjectAnimationBase.cs
- WebPartZoneBase.cs
- Label.cs
- FileSystemWatcher.cs
- SafeNativeMethods.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- CachedCompositeFamily.cs
- MatrixTransform.cs
- FormView.cs
- unsafenativemethodsother.cs
- WebPartHelpVerb.cs
- HttpCacheVary.cs
- MatrixValueSerializer.cs
- ObjectListItem.cs
- CodeCompileUnit.cs
- DesigntimeLicenseContextSerializer.cs
- XmlILOptimizerVisitor.cs
- ImageCollectionEditor.cs
- ValueConversionAttribute.cs
- CodeTypeOfExpression.cs
- XmlUtf8RawTextWriter.cs
- Route.cs
- UnmanagedHandle.cs
- Model3D.cs
- StandardOleMarshalObject.cs
- ResourcesGenerator.cs
- SettingsSection.cs
- EndOfStreamException.cs
- RemotingConfigParser.cs
- TextBoxRenderer.cs
- CommonObjectSecurity.cs
- CrossAppDomainChannel.cs
- DesignerLinkAdapter.cs
- HtmlInputFile.cs
- NetworkAddressChange.cs
- FormatVersion.cs
- Size3DValueSerializer.cs
- basenumberconverter.cs
- PagesChangedEventArgs.cs
- FilterQueryOptionExpression.cs
- TableItemProviderWrapper.cs
- OpenTypeLayout.cs
- SafeRightsManagementEnvironmentHandle.cs
- MetadataWorkspace.cs
- UntypedNullExpression.cs
- Image.cs
- OperatingSystem.cs
- UnknownWrapper.cs
- ConnectionOrientedTransportElement.cs
- GradientBrush.cs
- DataSourceExpression.cs
- TagMapInfo.cs
- FileLoadException.cs
- DeferredTextReference.cs
- DoubleCollectionValueSerializer.cs
- ColorConverter.cs
- OrCondition.cs
- Pkcs7Signer.cs
- RestHandler.cs
- TraceLog.cs
- DataGridViewColumnCollection.cs
- ApplicationContext.cs
- LiteralDesigner.cs
- StorageEndPropertyMapping.cs
- DataIdProcessor.cs
- Comparer.cs
- ReadOnlyCollectionBase.cs
- ScrollProviderWrapper.cs
- CodeVariableReferenceExpression.cs
- XmlNamespaceMapping.cs
- RowsCopiedEventArgs.cs
- DropShadowBitmapEffect.cs
- ClientConfigurationHost.cs
- _SingleItemRequestCache.cs
- HitTestFilterBehavior.cs
- AstNode.cs
- InertiaExpansionBehavior.cs
- ContextQuery.cs
- Command.cs
- ConfigurationPropertyAttribute.cs
- OdbcConnection.cs
- FirstQueryOperator.cs
- InstancePersistenceException.cs
- XmlReflectionImporter.cs
- PrimaryKeyTypeConverter.cs