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
- RegistryConfigurationProvider.cs
- GridPattern.cs
- DiffuseMaterial.cs
- QueryResponse.cs
- OrderByExpression.cs
- TypeInfo.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ListSortDescriptionCollection.cs
- Trace.cs
- ComponentChangingEvent.cs
- CacheHelper.cs
- Property.cs
- FacetValueContainer.cs
- XmlBinaryReaderSession.cs
- BaseCAMarshaler.cs
- MatrixCamera.cs
- CheckableControlBaseAdapter.cs
- StandardBindingImporter.cs
- Section.cs
- parserscommon.cs
- SimpleType.cs
- ImportContext.cs
- ObjectReferenceStack.cs
- KnownBoxes.cs
- DataSourceHelper.cs
- COM2EnumConverter.cs
- UrlPath.cs
- CompModSwitches.cs
- ProgressPage.cs
- SchemaCollectionCompiler.cs
- Wizard.cs
- SessionPageStateSection.cs
- DateTimeFormatInfo.cs
- TextFormatterHost.cs
- DataGridViewButtonCell.cs
- TemplateXamlParser.cs
- DbParameterCollection.cs
- RTLAwareMessageBox.cs
- TextEditorContextMenu.cs
- _NegoStream.cs
- MDIWindowDialog.cs
- Stacktrace.cs
- ExpressionBuilder.cs
- Preprocessor.cs
- BatchStream.cs
- DoubleUtil.cs
- Cursors.cs
- RtfControlWordInfo.cs
- ResXResourceWriter.cs
- TextDpi.cs
- Trace.cs
- LiteralTextContainerControlBuilder.cs
- XmlSchemaValidator.cs
- SqlRewriteScalarSubqueries.cs
- unsafenativemethodstextservices.cs
- CompositeTypefaceMetrics.cs
- VerticalAlignConverter.cs
- CounterSample.cs
- SortDescription.cs
- ZipPackagePart.cs
- UnsafeNativeMethods.cs
- PenThread.cs
- DNS.cs
- WebSysDisplayNameAttribute.cs
- InternalMappingException.cs
- IFormattable.cs
- ProviderUtil.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- EntityDataSourceDataSelectionPanel.cs
- SingleConverter.cs
- TypeConverterValueSerializer.cs
- DataListItemCollection.cs
- MenuItemBindingCollection.cs
- TextSelectionHighlightLayer.cs
- NegatedCellConstant.cs
- DataFormats.cs
- ArrayWithOffset.cs
- Point4D.cs
- ClientOptions.cs
- ToolStripOverflowButton.cs
- HtmlWindow.cs
- LicenseContext.cs
- OutputScopeManager.cs
- SubtreeProcessor.cs
- NGCSerializer.cs
- AtomServiceDocumentSerializer.cs
- WebPartPersonalization.cs
- TextCompositionManager.cs
- XPathArrayIterator.cs
- SpecialTypeDataContract.cs
- MruCache.cs
- SiteMapNodeItemEventArgs.cs
- LambdaCompiler.ControlFlow.cs
- InvalidDocumentContentsException.cs
- ViewStateException.cs
- DefaultPrintController.cs
- PackageRelationship.cs
- ControlCollection.cs
- SpeechUI.cs
- IIS7WorkerRequest.cs