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
- FastPropertyAccessor.cs
- BrowserCapabilitiesFactoryBase.cs
- UIElementPropertyUndoUnit.cs
- DynamicValidatorEventArgs.cs
- TrackingProfile.cs
- Errors.cs
- figurelengthconverter.cs
- MetadataPropertyAttribute.cs
- BatchWriter.cs
- ObjectDataSourceDesigner.cs
- SortableBindingList.cs
- WebPageTraceListener.cs
- DependencyPropertyKind.cs
- XmlSerializationWriter.cs
- EncryptedPackage.cs
- SqlInternalConnectionTds.cs
- DataGridViewImageCell.cs
- FixedElement.cs
- DataGridViewDataErrorEventArgs.cs
- XmlBuffer.cs
- ProcessModuleDesigner.cs
- QueryStringConverter.cs
- InlinedAggregationOperator.cs
- MarshalDirectiveException.cs
- ChangeInterceptorAttribute.cs
- Typography.cs
- SoapElementAttribute.cs
- StylusEditingBehavior.cs
- CheckedPointers.cs
- ContainerSelectorBehavior.cs
- ClientConfigPaths.cs
- LinkArea.cs
- DataBoundControlAdapter.cs
- NotSupportedException.cs
- ActivitySurrogateSelector.cs
- brushes.cs
- CompModHelpers.cs
- PasswordBox.cs
- ParentUndoUnit.cs
- ApplicationInfo.cs
- ComAdminInterfaces.cs
- SystemIPGlobalStatistics.cs
- XmlIncludeAttribute.cs
- HandlerMappingMemo.cs
- StyleTypedPropertyAttribute.cs
- ViewLoader.cs
- UdpDiscoveryEndpoint.cs
- sqlcontext.cs
- DictionaryKeyPropertyAttribute.cs
- Registration.cs
- WindowsAuthenticationEventArgs.cs
- InvariantComparer.cs
- PreApplicationStartMethodAttribute.cs
- InternalException.cs
- SurrogateDataContract.cs
- WebPartConnection.cs
- SingleAnimationBase.cs
- PropertyMetadata.cs
- ExtentJoinTreeNode.cs
- ValueQuery.cs
- IssuedSecurityTokenParameters.cs
- UnauthorizedWebPart.cs
- BlurEffect.cs
- ToolStripSeparatorRenderEventArgs.cs
- LoadWorkflowCommand.cs
- FormatterServices.cs
- safelink.cs
- MergablePropertyAttribute.cs
- MissingMemberException.cs
- VisualStyleElement.cs
- FileLogRecordStream.cs
- TextViewDesigner.cs
- RepeaterItem.cs
- StaticFileHandler.cs
- ToolStripPanelRenderEventArgs.cs
- AppDomainFactory.cs
- BrowserCapabilitiesCompiler.cs
- VarRemapper.cs
- DesignTimeParseData.cs
- BrowserDefinitionCollection.cs
- MergeFilterQuery.cs
- NumberSubstitution.cs
- StandardBindingOptionalReliableSessionElement.cs
- TextContainerChangeEventArgs.cs
- SemanticBasicElement.cs
- PreviewKeyDownEventArgs.cs
- XmlParserContext.cs
- ControlIdConverter.cs
- XamlWriter.cs
- XmlReturnReader.cs
- WebScriptEnablingElement.cs
- ObjectViewListener.cs
- XmlSchemaGroupRef.cs
- followingsibling.cs
- SqlUtil.cs
- CultureInfoConverter.cs
- Metafile.cs
- UserControl.cs
- UnmanagedMemoryStreamWrapper.cs
- DrawingAttributeSerializer.cs