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
- RoutingEndpointTrait.cs
- ViewPort3D.cs
- BindingOperations.cs
- ParallelTimeline.cs
- TreeViewImageIndexConverter.cs
- MappedMetaModel.cs
- LogStore.cs
- EventLogEntryCollection.cs
- GridEntryCollection.cs
- ellipse.cs
- EntityDataSourceWrapper.cs
- LocatorPart.cs
- InternalConfigSettingsFactory.cs
- StyleBamlTreeBuilder.cs
- XmlAutoDetectWriter.cs
- BoolExpr.cs
- MimeReflector.cs
- TaiwanLunisolarCalendar.cs
- WindowsStatusBar.cs
- MatrixTransform3D.cs
- FontStyleConverter.cs
- webeventbuffer.cs
- InputBinding.cs
- Msmq.cs
- AnimationLayer.cs
- MorphHelper.cs
- EncodingDataItem.cs
- HotSpot.cs
- CalendarTable.cs
- EventSinkActivityDesigner.cs
- UIElement3D.cs
- BitmapFrame.cs
- Brushes.cs
- SystemResources.cs
- AppDomainInstanceProvider.cs
- LayoutTableCell.cs
- SchemaTableColumn.cs
- Underline.cs
- LicFileLicenseProvider.cs
- XmlSerializationWriter.cs
- SecurityUtils.cs
- CompatibleComparer.cs
- Marshal.cs
- MemberMaps.cs
- PngBitmapEncoder.cs
- TemplateXamlTreeBuilder.cs
- DataGridViewHitTestInfo.cs
- CustomErrorsSection.cs
- DescendantOverDescendantQuery.cs
- CustomTypeDescriptor.cs
- TextRangeEdit.cs
- ObservableCollectionDefaultValueFactory.cs
- PageStatePersister.cs
- SimpleType.cs
- SplineKeyFrames.cs
- NavigationPropertySingletonExpression.cs
- DataGridTableCollection.cs
- HitTestWithPointDrawingContextWalker.cs
- HashMembershipCondition.cs
- CodeDefaultValueExpression.cs
- Help.cs
- CorrelationTokenTypeConvertor.cs
- PresentationAppDomainManager.cs
- SpellCheck.cs
- ApplicationSecurityManager.cs
- SoapIgnoreAttribute.cs
- CompositeCollectionView.cs
- ApplicationException.cs
- HostedElements.cs
- AppSettingsExpressionBuilder.cs
- FontStyle.cs
- Italic.cs
- ContentType.cs
- ListBoxChrome.cs
- SubMenuStyleCollection.cs
- BehaviorService.cs
- CqlErrorHelper.cs
- WpfPayload.cs
- TabletDevice.cs
- CanExpandCollapseAllConverter.cs
- xsdvalidator.cs
- AsyncOperationManager.cs
- JapaneseLunisolarCalendar.cs
- SineEase.cs
- ProtocolState.cs
- Line.cs
- AnnotationResourceChangedEventArgs.cs
- HttpSysSettings.cs
- SystemIPv4InterfaceProperties.cs
- ProfessionalColorTable.cs
- WebPartsSection.cs
- ScheduleChanges.cs
- XPathQilFactory.cs
- autovalidator.cs
- LogRestartAreaEnumerator.cs
- PersianCalendar.cs
- FileCodeGroup.cs
- FormViewCommandEventArgs.cs
- SmtpLoginAuthenticationModule.cs
- SystemDropShadowChrome.cs