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
- CodePageEncoding.cs
- DbCommandDefinition.cs
- StorageModelBuildProvider.cs
- ValidatorCollection.cs
- SubtreeProcessor.cs
- InputProviderSite.cs
- CrossAppDomainChannel.cs
- PageWrapper.cs
- EmptyStringExpandableObjectConverter.cs
- CompositeDataBoundControl.cs
- ItemAutomationPeer.cs
- FolderBrowserDialog.cs
- DeploymentSection.cs
- HostingEnvironmentSection.cs
- TableRowCollection.cs
- GlobalizationSection.cs
- LoginDesigner.cs
- sapiproxy.cs
- CanonicalFormWriter.cs
- XmlQualifiedNameTest.cs
- TaskFileService.cs
- InstanceDataCollection.cs
- BindableTemplateBuilder.cs
- Main.cs
- DotExpr.cs
- WmfPlaceableFileHeader.cs
- DataGridViewRowEventArgs.cs
- HtmlInputRadioButton.cs
- ValueUtilsSmi.cs
- DesignBindingPropertyDescriptor.cs
- Int32CollectionValueSerializer.cs
- Authorization.cs
- DBCSCodePageEncoding.cs
- CLSCompliantAttribute.cs
- DesignerHost.cs
- SoundPlayerAction.cs
- ReflectionUtil.cs
- LoginView.cs
- ColumnWidthChangingEvent.cs
- SqlDataRecord.cs
- Composition.cs
- ProviderCollection.cs
- LogArchiveSnapshot.cs
- AccessControlEntry.cs
- GridItemCollection.cs
- NavigationFailedEventArgs.cs
- MappedMetaModel.cs
- ConstructorBuilder.cs
- InvalidOperationException.cs
- DelayedRegex.cs
- XmlFormatMapping.cs
- XmlDataCollection.cs
- Formatter.cs
- RemoteWebConfigurationHostServer.cs
- RegularExpressionValidator.cs
- DataGridViewCellCancelEventArgs.cs
- LinkDescriptor.cs
- MailFileEditor.cs
- HierarchicalDataSourceControl.cs
- ExtenderControl.cs
- IntegrationExceptionEventArgs.cs
- NodeFunctions.cs
- ObjectTokenCategory.cs
- SqlDataSourceCustomCommandPanel.cs
- AllMembershipCondition.cs
- DiagnosticStrings.cs
- ChildrenQuery.cs
- SubqueryRules.cs
- MenuBindingsEditor.cs
- PageCodeDomTreeGenerator.cs
- CodeDesigner.cs
- FileSystemWatcher.cs
- RefreshPropertiesAttribute.cs
- MenuTracker.cs
- SrgsText.cs
- SqlReferenceCollection.cs
- StringFormat.cs
- CodeGroup.cs
- XmlAttributeProperties.cs
- PageTrueTypeFont.cs
- WebResponse.cs
- WebPartConnectionsCancelVerb.cs
- HandlerWithFactory.cs
- SoapServerProtocol.cs
- propertyentry.cs
- CssTextWriter.cs
- processwaithandle.cs
- SQLInt32Storage.cs
- ContainerUtilities.cs
- BuildProvidersCompiler.cs
- Renderer.cs
- OAVariantLib.cs
- BasicViewGenerator.cs
- AnimationLayer.cs
- LocalValueEnumerator.cs
- PageScaling.cs
- TemplatePropertyEntry.cs
- XmlNodeList.cs
- ReadContentAsBinaryHelper.cs
- DoubleSumAggregationOperator.cs