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
- OleDbReferenceCollection.cs
- RoutingConfiguration.cs
- IntPtr.cs
- SerialReceived.cs
- SkewTransform.cs
- AsmxEndpointPickerExtension.cs
- VoiceChangeEventArgs.cs
- WebPartTracker.cs
- UIElement3D.cs
- SqlMethodAttribute.cs
- RoutedEvent.cs
- xamlnodes.cs
- ToolStripTextBox.cs
- WmlPhoneCallAdapter.cs
- ContentFileHelper.cs
- OleDbPropertySetGuid.cs
- EditorAttribute.cs
- ControlPropertyNameConverter.cs
- FontStyles.cs
- SrgsDocumentParser.cs
- OracleTimeSpan.cs
- SurrogateChar.cs
- Message.cs
- XPathMultyIterator.cs
- Ipv6Element.cs
- PanelDesigner.cs
- UshortList2.cs
- AuthorizationSection.cs
- SerialReceived.cs
- DetailsViewDeletedEventArgs.cs
- TaiwanCalendar.cs
- HttpRuntime.cs
- ScriptReference.cs
- PositiveTimeSpanValidator.cs
- CodeDomComponentSerializationService.cs
- ToolStripItemRenderEventArgs.cs
- ScriptingProfileServiceSection.cs
- TargetInvocationException.cs
- SectionInput.cs
- GlyphInfoList.cs
- EncoderNLS.cs
- SafeNativeMethods.cs
- Scripts.cs
- Menu.cs
- FixedDocumentSequencePaginator.cs
- GeneralTransform2DTo3DTo2D.cs
- EdmComplexTypeAttribute.cs
- BuildProviderCollection.cs
- MouseButtonEventArgs.cs
- AffineTransform3D.cs
- ToolStripContainer.cs
- IsolatedStorageFile.cs
- SqlHelper.cs
- ToolStripTextBox.cs
- BrushConverter.cs
- SizeFConverter.cs
- EntityDataSourceContextCreatingEventArgs.cs
- UTF7Encoding.cs
- WebDescriptionAttribute.cs
- WindowInteropHelper.cs
- CategoryValueConverter.cs
- IApplicationTrustManager.cs
- XmlSchemaSimpleContent.cs
- TreeViewItemAutomationPeer.cs
- StringFormat.cs
- PropertyGrid.cs
- BufferAllocator.cs
- TableItemStyle.cs
- RouteUrlExpressionBuilder.cs
- DataGridViewCellParsingEventArgs.cs
- PrintingPermission.cs
- SharedDp.cs
- RoutedEventArgs.cs
- VerificationAttribute.cs
- NonClientArea.cs
- EventDescriptorCollection.cs
- PersonalizationProviderCollection.cs
- ResourceExpressionBuilder.cs
- WebConfigurationManager.cs
- PolicyStatement.cs
- NamedPipeProcessProtocolHandler.cs
- DeploymentExceptionMapper.cs
- PermissionSetEnumerator.cs
- ScriptResourceHandler.cs
- StandardBindingElementCollection.cs
- FunctionMappingTranslator.cs
- PropertyTab.cs
- SocketElement.cs
- ListViewHitTestInfo.cs
- MsmqMessageProperty.cs
- WebPartAuthorizationEventArgs.cs
- newinstructionaction.cs
- DockEditor.cs
- FamilyCollection.cs
- Resources.Designer.cs
- WindowsRichEditRange.cs
- DataTableReader.cs
- CompiledRegexRunner.cs
- HuffmanTree.cs
- Directory.cs