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 / 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
- TreeViewHitTestInfo.cs
- FileLoadException.cs
- HttpDebugHandler.cs
- CryptoApi.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- DockPattern.cs
- ListViewItemSelectionChangedEvent.cs
- NameValueSectionHandler.cs
- TargetException.cs
- XmlElementAttributes.cs
- CacheOutputQuery.cs
- QuaternionAnimation.cs
- SHA256Managed.cs
- ParseElementCollection.cs
- EncoderExceptionFallback.cs
- GeneralTransform3DGroup.cs
- TaskFormBase.cs
- SubordinateTransaction.cs
- LeafCellTreeNode.cs
- ContainerFilterService.cs
- TextLineBreak.cs
- ErrorWebPart.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- TypeDependencyAttribute.cs
- MimeMultiPart.cs
- RightsManagementEncryptionTransform.cs
- EventTask.cs
- DataGridBoolColumn.cs
- SoapEnvelopeProcessingElement.cs
- Pair.cs
- UseAttributeSetsAction.cs
- querybuilder.cs
- PerformanceCountersElement.cs
- QuaternionAnimation.cs
- ClientFormsIdentity.cs
- ClientProxyGenerator.cs
- CheckBox.cs
- GrammarBuilderDictation.cs
- ListDictionary.cs
- UnsafeNativeMethods.cs
- SoapMessage.cs
- MediaEntryAttribute.cs
- VideoDrawing.cs
- PageCodeDomTreeGenerator.cs
- ContainsSearchOperator.cs
- StringUtil.cs
- DesignTimeParseData.cs
- ColorAnimation.cs
- EnvelopedSignatureTransform.cs
- DataShape.cs
- CodeMemberProperty.cs
- UTF7Encoding.cs
- MediaCommands.cs
- DomNameTable.cs
- AsyncDataRequest.cs
- Double.cs
- UnmanagedBitmapWrapper.cs
- TextSegment.cs
- XslTransform.cs
- CellParagraph.cs
- GACIdentityPermission.cs
- ThreadWorkerController.cs
- StylusEditingBehavior.cs
- GridProviderWrapper.cs
- WaitHandleCannotBeOpenedException.cs
- Msec.cs
- ModuleBuilderData.cs
- IPipelineRuntime.cs
- FolderBrowserDialog.cs
- ClientBuildManagerCallback.cs
- DbConnectionInternal.cs
- TreeNodeCollectionEditorDialog.cs
- ToolStripContainer.cs
- DependencyObject.cs
- MapPathBasedVirtualPathProvider.cs
- ProxyWebPartConnectionCollection.cs
- WsdlBuildProvider.cs
- RegisteredExpandoAttribute.cs
- BuilderInfo.cs
- WebEncodingValidator.cs
- ToolStripDropTargetManager.cs
- Message.cs
- TextEditorLists.cs
- WebBrowserContainer.cs
- UIElement3D.cs
- StreamReader.cs
- OrderedParallelQuery.cs
- ConnectionStringsExpressionBuilder.cs
- PageAsyncTask.cs
- EdmItemCollection.cs
- AuthorizationRule.cs
- GridViewAutomationPeer.cs
- ApplicationServiceManager.cs
- CompilationAssemblyInstallComponent.cs
- EventLogPropertySelector.cs
- TextDecorationCollection.cs
- Style.cs
- SchemaEntity.cs
- FrameworkTextComposition.cs
- Pair.cs