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
- WorkflowViewElement.cs
- ElementUtil.cs
- TextBoxAutomationPeer.cs
- MobileListItem.cs
- LogSwitch.cs
- BackgroundFormatInfo.cs
- PhysicalAddress.cs
- Vector3D.cs
- ToolStripOverflowButton.cs
- SyndicationPerson.cs
- DependentList.cs
- UserPreferenceChangingEventArgs.cs
- SHA1Cng.cs
- CommentEmitter.cs
- XmlTypeAttribute.cs
- WithStatement.cs
- SoapDocumentServiceAttribute.cs
- ClientUrlResolverWrapper.cs
- ElementUtil.cs
- AuthorizationContext.cs
- ProfilePropertySettingsCollection.cs
- TreeViewDataItemAutomationPeer.cs
- SchemaImporterExtension.cs
- ToolBarOverflowPanel.cs
- _ListenerAsyncResult.cs
- EUCJPEncoding.cs
- SystemWebSectionGroup.cs
- StringAnimationUsingKeyFrames.cs
- UriSection.cs
- DesignColumnCollection.cs
- OleDbCommandBuilder.cs
- SqlMethodCallConverter.cs
- FormsIdentity.cs
- XmlParserContext.cs
- DES.cs
- RequestedSignatureDialog.cs
- TabPage.cs
- SymmetricKeyWrap.cs
- SamlConditions.cs
- ISCIIEncoding.cs
- TypeForwardedToAttribute.cs
- Matrix3DStack.cs
- DataRecordInternal.cs
- HttpCapabilitiesEvaluator.cs
- DateTimeAutomationPeer.cs
- ClientConvert.cs
- PngBitmapEncoder.cs
- DataGridViewRowPostPaintEventArgs.cs
- ObjectListCommand.cs
- DBConnection.cs
- SettingsPropertyValue.cs
- ToolStripDesigner.cs
- XmlDictionary.cs
- SourceFileBuildProvider.cs
- EdmType.cs
- RSAOAEPKeyExchangeDeformatter.cs
- altserialization.cs
- OdbcErrorCollection.cs
- PageMediaSize.cs
- FileLevelControlBuilderAttribute.cs
- Wildcard.cs
- FileNotFoundException.cs
- CorrelationManager.cs
- ErrorHandlingAcceptor.cs
- SettingsPropertyNotFoundException.cs
- PresentationSource.cs
- ECDiffieHellman.cs
- SizeAnimationClockResource.cs
- PasswordDeriveBytes.cs
- PolyLineSegment.cs
- ObjectViewFactory.cs
- XmlTextWriter.cs
- CompiledAction.cs
- DataTableMappingCollection.cs
- AnimationStorage.cs
- SoapInteropTypes.cs
- UnsafeNativeMethods.cs
- ThemeDirectoryCompiler.cs
- ExtensionSimplifierMarkupObject.cs
- TakeQueryOptionExpression.cs
- RuleAction.cs
- WebContext.cs
- InternalBufferOverflowException.cs
- SaveCardRequest.cs
- TranslateTransform3D.cs
- OutputCacheSection.cs
- FacetValues.cs
- basemetadatamappingvisitor.cs
- HotSpot.cs
- Soap.cs
- ClusterRegistryConfigurationProvider.cs
- ImageClickEventArgs.cs
- WindowHideOrCloseTracker.cs
- DelegatingChannelListener.cs
- HtmlInputPassword.cs
- PathFigure.cs
- InputReportEventArgs.cs
- WebPartConnectionsDisconnectVerb.cs
- NetMsmqSecurityElement.cs
- FileAccessException.cs