Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / HwndHostAutomationPeer.cs / 1305600 / 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
- SharedPerformanceCounter.cs
- SafeTimerHandle.cs
- XpsSerializerFactory.cs
- FormsAuthenticationEventArgs.cs
- ExpressionNode.cs
- BindingCompleteEventArgs.cs
- UndirectedGraph.cs
- DeviceContext.cs
- SqlProcedureAttribute.cs
- ParseHttpDate.cs
- ConfigurationManagerHelper.cs
- ListControl.cs
- GridItemCollection.cs
- DbConnectionOptions.cs
- DropShadowEffect.cs
- SelfIssuedAuthProofToken.cs
- EllipseGeometry.cs
- XmlSchemaInclude.cs
- OutputScopeManager.cs
- TextEditorSpelling.cs
- BaseValidatorDesigner.cs
- ColumnHeaderConverter.cs
- WebServiceTypeData.cs
- RawUIStateInputReport.cs
- _ListenerAsyncResult.cs
- CngProperty.cs
- SqlXmlStorage.cs
- AccessViolationException.cs
- Bezier.cs
- HttpProtocolReflector.cs
- CmsInterop.cs
- RewritingPass.cs
- SemaphoreSecurity.cs
- IBuiltInEvidence.cs
- PropertyConverter.cs
- FieldToken.cs
- GradientStopCollection.cs
- RoutedPropertyChangedEventArgs.cs
- EncryptionUtility.cs
- DockAndAnchorLayout.cs
- ToolStripSplitButton.cs
- ReadOnlyPropertyMetadata.cs
- DesignerTransaction.cs
- Roles.cs
- StringAnimationUsingKeyFrames.cs
- Collection.cs
- FrameworkElement.cs
- QueueProcessor.cs
- SqlConnectionString.cs
- SqlDataRecord.cs
- TokenFactoryBase.cs
- InheritanceRules.cs
- ListSortDescriptionCollection.cs
- UriTemplateClientFormatter.cs
- FileCodeGroup.cs
- WebPartAuthorizationEventArgs.cs
- CommonGetThemePartSize.cs
- DataGridViewSelectedCellCollection.cs
- Bitmap.cs
- AudienceUriMode.cs
- ILGenerator.cs
- DataListCommandEventArgs.cs
- FontUnitConverter.cs
- DataGridViewRowCancelEventArgs.cs
- BitmapCacheBrush.cs
- sqlinternaltransaction.cs
- FormatterConverter.cs
- ImpersonationContext.cs
- IntranetCredentialPolicy.cs
- DataGridViewCellEventArgs.cs
- ByteStreamGeometryContext.cs
- SortQuery.cs
- HostProtectionPermission.cs
- ColumnWidthChangedEvent.cs
- SafeBuffer.cs
- LostFocusEventManager.cs
- AuthenticationModuleElementCollection.cs
- TabRenderer.cs
- ApplicationDirectory.cs
- RadioButton.cs
- TimeSpanValidator.cs
- PathFigureCollection.cs
- DataServiceContext.cs
- StreamingContext.cs
- PagerStyle.cs
- NavigationHelper.cs
- TableItemPatternIdentifiers.cs
- XmlBinaryWriter.cs
- uribuilder.cs
- DataListItemEventArgs.cs
- NavigationWindow.cs
- IUnknownConstantAttribute.cs
- Cursor.cs
- IdentityModelDictionary.cs
- PtsPage.cs
- AuthStoreRoleProvider.cs
- Relationship.cs
- DictionaryContent.cs
- BevelBitmapEffect.cs
- DBCSCodePageEncoding.cs