Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / WinFormsIntegration / System / Windows / Automation / Peers / WindowsFormsHostAutomationPeer.cs / 1 / WindowsFormsHostAutomationPeer.cs
using System.Windows.Automation; using System.Windows.Automation.Provider; using System.Windows.Forms.Integration; using System.Security; using System.Security.Permissions; namespace System.Windows.Automation.Peers { /// public sealed class WindowsFormsHostAutomationPeer : FrameworkElementAutomationPeer { /// [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] public WindowsFormsHostAutomationPeer(WindowsFormsHost owner): base(owner) {} /// override protected string GetClassNameCore() { return "WindowsFormsHost"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Pane; } /// override protected bool IsHwndHost { get { return true; }} ////// Critical - Calls critical HwndHost.Handle. /// TreatAsSafe - This demands full trust, so it's safe /// [SecurityCritical, SecurityTreatAsSafe] [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] override protected HostedWindowWrapper GetHostRawElementProviderCore() { HostedWindowWrapper host = null; WindowsFormsHost wfh = (WindowsFormsHost)Owner; IntPtr hwnd = wfh.Handle; if(hwnd != IntPtr.Zero) { host = new HostedWindowWrapper(hwnd); } return host; } internal IRawElementProviderSimple GetProvider() { return ProviderFromPeer(this); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System.Windows.Automation; using System.Windows.Automation.Provider; using System.Windows.Forms.Integration; using System.Security; using System.Security.Permissions; namespace System.Windows.Automation.Peers { /// public sealed class WindowsFormsHostAutomationPeer : FrameworkElementAutomationPeer { /// [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] public WindowsFormsHostAutomationPeer(WindowsFormsHost owner): base(owner) {} /// override protected string GetClassNameCore() { return "WindowsFormsHost"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Pane; } /// override protected bool IsHwndHost { get { return true; }} ////// Critical - Calls critical HwndHost.Handle. /// TreatAsSafe - This demands full trust, so it's safe /// [SecurityCritical, SecurityTreatAsSafe] [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] override protected HostedWindowWrapper GetHostRawElementProviderCore() { HostedWindowWrapper host = null; WindowsFormsHost wfh = (WindowsFormsHost)Owner; IntPtr hwnd = wfh.Handle; if(hwnd != IntPtr.Zero) { host = new HostedWindowWrapper(hwnd); } return host; } internal IRawElementProviderSimple GetProvider() { return ProviderFromPeer(this); } } } // 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
- StringOutput.cs
- RegexTree.cs
- MarshalByRefObject.cs
- ToolStripTextBox.cs
- DecimalFormatter.cs
- InvalidComObjectException.cs
- RequestCacheManager.cs
- MouseButton.cs
- Calendar.cs
- RoutedEventArgs.cs
- KnowledgeBase.cs
- InvalidProgramException.cs
- SAPIEngineTypes.cs
- XNodeNavigator.cs
- EnumerationRangeValidationUtil.cs
- ConfigPathUtility.cs
- ValidationErrorEventArgs.cs
- ConfigXmlElement.cs
- PathFigureCollectionConverter.cs
- ScrollBarRenderer.cs
- ToolStripSeparatorRenderEventArgs.cs
- SQLGuid.cs
- WebPartVerb.cs
- IndependentlyAnimatedPropertyMetadata.cs
- MessageRpc.cs
- ColumnHeaderConverter.cs
- Scene3D.cs
- ProfileEventArgs.cs
- KnownColorTable.cs
- ByteViewer.cs
- HyperLinkField.cs
- ProcessModelInfo.cs
- TagPrefixCollection.cs
- ObjectMaterializedEventArgs.cs
- PanningMessageFilter.cs
- Mapping.cs
- BamlRecords.cs
- DataGridLinkButton.cs
- ReadOnlyHierarchicalDataSourceView.cs
- SimpleWebHandlerParser.cs
- Panel.cs
- RecordManager.cs
- ErrorFormatterPage.cs
- ListViewInsertedEventArgs.cs
- MenuItem.cs
- AssemblyHelper.cs
- NamespaceDisplay.xaml.cs
- EntityDataSourceChangedEventArgs.cs
- WebReferencesBuildProvider.cs
- PageCodeDomTreeGenerator.cs
- StrongBox.cs
- OutputWindow.cs
- ItemsControlAutomationPeer.cs
- cookiecollection.cs
- UnsafeNativeMethods.cs
- RouteUrlExpressionBuilder.cs
- safelinkcollection.cs
- Crc32Helper.cs
- KerberosRequestorSecurityToken.cs
- CachedPathData.cs
- SynchronizationContext.cs
- AssemblyBuilderData.cs
- Operators.cs
- Propagator.Evaluator.cs
- ping.cs
- OleDbCommand.cs
- DesignBindingPropertyDescriptor.cs
- SlipBehavior.cs
- RepeatEnumerable.cs
- BaseTransportHeaders.cs
- BinHexDecoder.cs
- CombinedGeometry.cs
- PlaceHolder.cs
- ToolStripKeyboardHandlingService.cs
- PropertyGridView.cs
- TextLineResult.cs
- DataGridViewColumnCollectionEditor.cs
- XmlSchemaCollection.cs
- PanelContainerDesigner.cs
- Dictionary.cs
- FileUtil.cs
- MostlySingletonList.cs
- Reference.cs
- Attributes.cs
- SiteMapProvider.cs
- CopyAttributesAction.cs
- TextTreeInsertElementUndoUnit.cs
- UxThemeWrapper.cs
- XsltException.cs
- HtmlHistory.cs
- ImageCodecInfoPrivate.cs
- ErrorEventArgs.cs
- ProcessProtocolHandler.cs
- ResXBuildProvider.cs
- DPCustomTypeDescriptor.cs
- PointConverter.cs
- DbInsertCommandTree.cs
- _LazyAsyncResult.cs
- ParallelTimeline.cs
- UnescapedXmlDiagnosticData.cs