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
- LayoutTableCell.cs
- OverrideMode.cs
- InvokeProviderWrapper.cs
- printdlgexmarshaler.cs
- BaseProcessor.cs
- DemultiplexingClientMessageFormatter.cs
- followingsibling.cs
- TableCellCollection.cs
- AutomationPatternInfo.cs
- VSWCFServiceContractGenerator.cs
- Currency.cs
- WmlValidationSummaryAdapter.cs
- AVElementHelper.cs
- HttpWebResponse.cs
- ActivityContext.cs
- ComContractElement.cs
- MetadataHelper.cs
- TabControlCancelEvent.cs
- FixedTextPointer.cs
- ParagraphVisual.cs
- OleDbParameterCollection.cs
- ToolboxItemAttribute.cs
- ZoneButton.cs
- MailMessageEventArgs.cs
- XPathChildIterator.cs
- Container.cs
- XmlNodeChangedEventManager.cs
- PeoplePickerWrapper.cs
- SafeNativeMethods.cs
- WindowInteropHelper.cs
- DescendantOverDescendantQuery.cs
- RelationshipEnd.cs
- ToolStripHighContrastRenderer.cs
- WebProxyScriptElement.cs
- KnownTypes.cs
- DataGridViewColumnCollectionEditor.cs
- MaskedTextProvider.cs
- MimePart.cs
- XPathScanner.cs
- XmlDataImplementation.cs
- PolyBezierSegmentFigureLogic.cs
- HttpProfileBase.cs
- RelationalExpressions.cs
- panel.cs
- Viewport2DVisual3D.cs
- AuthorizationSection.cs
- MetadataCache.cs
- AppDomain.cs
- AuthStoreRoleProvider.cs
- IPEndPointCollection.cs
- EventPropertyMap.cs
- TextBox.cs
- NameSpaceEvent.cs
- DataView.cs
- RangeValidator.cs
- ControlBindingsCollection.cs
- NullableDecimalAverageAggregationOperator.cs
- TextRangeProviderWrapper.cs
- AssemblyBuilder.cs
- SqlTypesSchemaImporter.cs
- TransactionProtocolConverter.cs
- ScalarConstant.cs
- CheckBoxField.cs
- CreateCardRequest.cs
- BidPrivateBase.cs
- SoapAttributeOverrides.cs
- DBNull.cs
- CharStorage.cs
- ConstructorBuilder.cs
- AxHostDesigner.cs
- AddInController.cs
- TabPageDesigner.cs
- DiscoveryReference.cs
- RadioButtonStandardAdapter.cs
- SafeFileMappingHandle.cs
- DocumentOrderComparer.cs
- Compiler.cs
- DefaultSection.cs
- TypeSystem.cs
- AppManager.cs
- ReaderContextStackData.cs
- BufferedGraphicsContext.cs
- SafeArrayTypeMismatchException.cs
- ClientConvert.cs
- MimeReturn.cs
- AsymmetricSignatureDeformatter.cs
- WpfPayload.cs
- ResolveNameEventArgs.cs
- GeneralTransform3DGroup.cs
- PromptStyle.cs
- TypeUtil.cs
- UriExt.cs
- CapacityStreamGeometryContext.cs
- PriorityRange.cs
- SymbolMethod.cs
- DockAndAnchorLayout.cs
- ReadOnlyHierarchicalDataSource.cs
- SQLDoubleStorage.cs
- SerializableAttribute.cs
- BindingList.cs