Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- AndMessageFilterTable.cs
- RangeValidator.cs
- TextEvent.cs
- TreeNodeStyle.cs
- HtmlLinkAdapter.cs
- ActivitySurrogateSelector.cs
- Table.cs
- ControlValuePropertyAttribute.cs
- ReadOnlyCollectionBase.cs
- CodeDomLocalizationProvider.cs
- HttpChannelBindingToken.cs
- KeyInfo.cs
- CodeChecksumPragma.cs
- ScalarOps.cs
- DbExpressionRules.cs
- ContainerUtilities.cs
- EncoderParameter.cs
- DbConnectionStringBuilder.cs
- XmlName.cs
- InfoCardTrace.cs
- SafeArchiveContext.cs
- XmlBindingWorker.cs
- Brush.cs
- WebPartsPersonalization.cs
- InstanceCreationEditor.cs
- RemotingSurrogateSelector.cs
- SqlXml.cs
- ResourceKey.cs
- WebPartCatalogCloseVerb.cs
- future.cs
- FactoryMaker.cs
- IgnorePropertiesAttribute.cs
- EntityDesignerUtils.cs
- SerializableAttribute.cs
- RtfFormatStack.cs
- ValidationSummary.cs
- PackageRelationshipSelector.cs
- CacheModeValueSerializer.cs
- DataService.cs
- PropertyChangedEventArgs.cs
- ListSortDescriptionCollection.cs
- TreeViewEvent.cs
- AssemblyInfo.cs
- BoolExpressionVisitors.cs
- XmlElement.cs
- Avt.cs
- SerializationSectionGroup.cs
- MemoryStream.cs
- InstanceStore.cs
- XmlBinaryReader.cs
- CancellationHandler.cs
- XmlnsDictionary.cs
- BrowserCapabilitiesFactory.cs
- BitmapEffectGeneralTransform.cs
- PropertyMappingExceptionEventArgs.cs
- UIPropertyMetadata.cs
- StorageAssociationSetMapping.cs
- RepeatInfo.cs
- dataprotectionpermissionattribute.cs
- BaseProcessProtocolHandler.cs
- TreeView.cs
- SelectionRange.cs
- sqlnorm.cs
- SqlDataReader.cs
- ValidateNames.cs
- TaskDesigner.cs
- SynchronizingStream.cs
- TypeUsage.cs
- OracleDateTime.cs
- DataGridCell.cs
- DataServiceException.cs
- AlphabeticalEnumConverter.cs
- QueryReaderSettings.cs
- ReadOnlyDictionary.cs
- BaseValidator.cs
- PathGradientBrush.cs
- SqlSelectStatement.cs
- Invariant.cs
- SoapElementAttribute.cs
- NamespaceListProperty.cs
- BaseDataBoundControl.cs
- CompositeScriptReference.cs
- ListBase.cs
- XmlChildNodes.cs
- ComProxy.cs
- XmlSchemaAppInfo.cs
- SoapMessage.cs
- XmlTypeAttribute.cs
- HeaderedContentControl.cs
- cache.cs
- TimeoutStream.cs
- EventManager.cs
- WmlPageAdapter.cs
- WebSysDescriptionAttribute.cs
- BamlResourceDeserializer.cs
- TextTreeTextBlock.cs
- MouseDevice.cs
- ReadOnlyPropertyMetadata.cs
- LassoSelectionBehavior.cs
- ObjectKeyFrameCollection.cs