Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- Matrix3DStack.cs
- BinaryConverter.cs
- SafeRightsManagementQueryHandle.cs
- FamilyMapCollection.cs
- DataControlCommands.cs
- OutputCacheProfile.cs
- QilReplaceVisitor.cs
- WindowsListViewItemCheckBox.cs
- DesignTimeTemplateParser.cs
- ToolBar.cs
- InstalledFontCollection.cs
- ServiceKnownTypeAttribute.cs
- SmtpMail.cs
- XhtmlConformanceSection.cs
- TemplateBindingExpressionConverter.cs
- CollectionExtensions.cs
- TrustManagerMoreInformation.cs
- ObjectViewEntityCollectionData.cs
- OdbcConnectionOpen.cs
- CacheMode.cs
- SimpleHandlerBuildProvider.cs
- ThreadLocal.cs
- ReadOnlyNameValueCollection.cs
- Site.cs
- PixelFormatConverter.cs
- GridViewRowEventArgs.cs
- StateItem.cs
- SymbolEqualComparer.cs
- IResourceProvider.cs
- TableItemPatternIdentifiers.cs
- Message.cs
- CodeIndexerExpression.cs
- XNodeValidator.cs
- ResourceAssociationSet.cs
- InternalMappingException.cs
- PropertyPanel.cs
- StorageAssociationTypeMapping.cs
- DataExpression.cs
- InvalidateEvent.cs
- InlinedLocationReference.cs
- XsdDataContractExporter.cs
- UICuesEvent.cs
- Utils.cs
- OrCondition.cs
- EpmAttributeNameBuilder.cs
- ZipIOExtraFieldPaddingElement.cs
- RegexGroup.cs
- DrawingGroup.cs
- XmlAutoDetectWriter.cs
- DocumentGridContextMenu.cs
- HierarchicalDataBoundControl.cs
- BitmapPalette.cs
- SmtpReplyReader.cs
- Executor.cs
- NativeMethods.cs
- DrawingImage.cs
- MethodImplAttribute.cs
- DeclarationUpdate.cs
- TimeoutConverter.cs
- WebPartTracker.cs
- DetectRunnableInstancesTask.cs
- GridProviderWrapper.cs
- LocalBuilder.cs
- WebServiceMethodData.cs
- AssociationSetEnd.cs
- EmissiveMaterial.cs
- ScriptingWebServicesSectionGroup.cs
- LicenseException.cs
- StringInfo.cs
- View.cs
- ToolStripDropDownClosingEventArgs.cs
- TextTreeTextBlock.cs
- storepermissionattribute.cs
- RegistrationServices.cs
- WebBrowserUriTypeConverter.cs
- BlockCollection.cs
- ReachDocumentPageSerializer.cs
- ControlValuePropertyAttribute.cs
- processwaithandle.cs
- PhysicalFontFamily.cs
- ToggleButton.cs
- SqlNotificationEventArgs.cs
- Span.cs
- HttpRequestBase.cs
- CryptoConfig.cs
- COAUTHIDENTITY.cs
- InternalSafeNativeMethods.cs
- ScalarOps.cs
- Win32PrintDialog.cs
- DataGridViewTopRowAccessibleObject.cs
- WebPartCollection.cs
- PageRequestManager.cs
- WebRequestModuleElement.cs
- PictureBox.cs
- Wizard.cs
- ListViewItem.cs
- WsatServiceCertificate.cs
- LockedActivityGlyph.cs
- CustomActivityDesigner.cs
- FixedSOMTableRow.cs