Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- TableLayoutColumnStyleCollection.cs
- InstanceValue.cs
- SafeHandles.cs
- VoiceObjectToken.cs
- ThreadInterruptedException.cs
- ValidationManager.cs
- RelationshipConverter.cs
- LicenseProviderAttribute.cs
- CodeTypeDeclaration.cs
- SchemaImporterExtensionElement.cs
- RectangleConverter.cs
- Pen.cs
- SqlEnums.cs
- CheckBoxField.cs
- Tokenizer.cs
- RuntimeTransactionHandle.cs
- HttpWriter.cs
- XmlQueryCardinality.cs
- XPathScanner.cs
- ToolStripSettings.cs
- FrameDimension.cs
- DependencyObjectProvider.cs
- DataFieldEditor.cs
- SimpleType.cs
- SqlTransaction.cs
- WeakReferenceKey.cs
- GC.cs
- FloatMinMaxAggregationOperator.cs
- SiteMapNodeItem.cs
- DummyDataSource.cs
- ValueUnavailableException.cs
- TextEffect.cs
- AsyncOperationManager.cs
- SqlDataSourceCommandEventArgs.cs
- RoutingService.cs
- SQLInt16.cs
- PaperSource.cs
- FrameworkContentElementAutomationPeer.cs
- DiagnosticsConfigurationHandler.cs
- GetCertificateRequest.cs
- PrefixQName.cs
- GraphicsContainer.cs
- WebPartHelpVerb.cs
- EventItfInfo.cs
- ToolStripControlHost.cs
- Inline.cs
- PrtCap_Public.cs
- PathStreamGeometryContext.cs
- RootProfilePropertySettingsCollection.cs
- ParameterReplacerVisitor.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- WebPartCatalogCloseVerb.cs
- Model3DCollection.cs
- TextUtf8RawTextWriter.cs
- ListViewAutomationPeer.cs
- PLINQETWProvider.cs
- Unit.cs
- CodeDomSerializerException.cs
- _PooledStream.cs
- SqlStatistics.cs
- GradientStopCollection.cs
- ControlCollection.cs
- HttpCapabilitiesSectionHandler.cs
- COM2Properties.cs
- Operator.cs
- MimeMultiPart.cs
- SqlStream.cs
- DataGridColumnStyleMappingNameEditor.cs
- XmlDataLoader.cs
- QilGenerator.cs
- DataReaderContainer.cs
- TextParagraphCache.cs
- XmlEntityReference.cs
- EmptyEnumerator.cs
- CodeArgumentReferenceExpression.cs
- TextSpanModifier.cs
- ToolStripLabel.cs
- StylusEventArgs.cs
- ThousandthOfEmRealPoints.cs
- ErrorHandler.cs
- EUCJPEncoding.cs
- TimeSpan.cs
- Control.cs
- FileDetails.cs
- AVElementHelper.cs
- DbProviderConfigurationHandler.cs
- GridViewRowPresenter.cs
- DynamicAttribute.cs
- QilInvoke.cs
- XmlSchemaElement.cs
- GridViewDeletedEventArgs.cs
- AnimationLayer.cs
- BinaryFormatter.cs
- TemplatedWizardStep.cs
- ISAPIWorkerRequest.cs
- WmlCalendarAdapter.cs
- FamilyMapCollection.cs
- TargetFrameworkUtil.cs
- ReflectTypeDescriptionProvider.cs
- ScriptHandlerFactory.cs