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
- TrustManagerPromptUI.cs
- OleDbStruct.cs
- DataObjectMethodAttribute.cs
- NativeMethods.cs
- Highlights.cs
- ScriptReference.cs
- DataSourceUtil.cs
- WebProxyScriptElement.cs
- ObjectNavigationPropertyMapping.cs
- RuntimeHandles.cs
- Propagator.cs
- SafePointer.cs
- CodeIdentifiers.cs
- TextServicesLoader.cs
- SystemUdpStatistics.cs
- EventProvider.cs
- RelationshipConverter.cs
- BaseComponentEditor.cs
- CompositeDataBoundControl.cs
- RTLAwareMessageBox.cs
- WindowsRegion.cs
- SelectionItemPattern.cs
- XsdValidatingReader.cs
- IsolationInterop.cs
- StubHelpers.cs
- FileRecordSequenceHelper.cs
- ChangePassword.cs
- ServiceHostingEnvironment.cs
- ToolStripMenuItem.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- QilTypeChecker.cs
- SystemColors.cs
- ListViewSelectEventArgs.cs
- ToolStripPanelDesigner.cs
- KeyInterop.cs
- XmlDomTextWriter.cs
- PageTheme.cs
- ModelItemCollection.cs
- RemotingException.cs
- Constraint.cs
- DtdParser.cs
- PreDigestedSignedInfo.cs
- ResourceContainer.cs
- WebConfigurationHostFileChange.cs
- PropertyChangeTracker.cs
- LinearGradientBrush.cs
- WebPartPersonalization.cs
- WorkflowDefinitionDispenser.cs
- Comparer.cs
- ObjectQuery_EntitySqlExtensions.cs
- DbCommandTree.cs
- IIS7WorkerRequest.cs
- TextCollapsingProperties.cs
- DictionaryKeyPropertyAttribute.cs
- XPathNavigatorReader.cs
- BitStream.cs
- XPathChildIterator.cs
- HttpGetServerProtocol.cs
- SR.cs
- DocumentApplicationJournalEntry.cs
- Hex.cs
- MobileUserControl.cs
- AuthenticationException.cs
- XmlnsCache.cs
- BuildProviderCollection.cs
- DoubleLinkListEnumerator.cs
- InstanceNameConverter.cs
- IItemProperties.cs
- SBCSCodePageEncoding.cs
- NamespaceCollection.cs
- SqlProcedureAttribute.cs
- XamlTemplateSerializer.cs
- SubqueryRules.cs
- RoutedEventHandlerInfo.cs
- PeekCompletedEventArgs.cs
- ViewBox.cs
- EntryPointNotFoundException.cs
- HttpPostedFile.cs
- DispatchWrapper.cs
- TextSchema.cs
- FixedDocumentPaginator.cs
- dsa.cs
- RewritingSimplifier.cs
- BamlRecordReader.cs
- SafeLibraryHandle.cs
- Logging.cs
- RequestCacheManager.cs
- XamlTreeBuilder.cs
- CommandBindingCollection.cs
- IProducerConsumerCollection.cs
- PolygonHotSpot.cs
- StringUtil.cs
- NamespaceDecl.cs
- RegisteredHiddenField.cs
- ElementHostPropertyMap.cs
- Blend.cs
- BoundField.cs
- SupportsEventValidationAttribute.cs
- BaseTypeViewSchema.cs
- TemplateBamlRecordReader.cs