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
- Walker.cs
- CachedFontFamily.cs
- DataRecordInfo.cs
- LinkDescriptor.cs
- StreamSecurityUpgradeProvider.cs
- SqlDataSourceCommandEventArgs.cs
- MimeMapping.cs
- ManifestResourceInfo.cs
- XmlDocumentFragment.cs
- WindowClosedEventArgs.cs
- PersonalizationProviderCollection.cs
- Restrictions.cs
- XmlDocumentSurrogate.cs
- ExecutionContext.cs
- NameObjectCollectionBase.cs
- UrlParameterReader.cs
- NameValuePair.cs
- DesignerVerb.cs
- CharacterMetrics.cs
- ParameterCollection.cs
- WebControlAdapter.cs
- StorageEntityContainerMapping.cs
- webeventbuffer.cs
- CssTextWriter.cs
- MultilineStringConverter.cs
- EventLogPermission.cs
- MediaScriptCommandRoutedEventArgs.cs
- BufferedStream.cs
- SapiRecoContext.cs
- InvokeHandlers.cs
- WebPartConnectionsEventArgs.cs
- DrawingGroup.cs
- SystemIcmpV4Statistics.cs
- PrintController.cs
- SourceChangedEventArgs.cs
- OpenTypeLayoutCache.cs
- XmlSchemaAnyAttribute.cs
- CryptoApi.cs
- Latin1Encoding.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- JsonObjectDataContract.cs
- RegisteredExpandoAttribute.cs
- BooleanStorage.cs
- WizardPanel.cs
- OTFRasterizer.cs
- Visual3D.cs
- RotateTransform.cs
- XhtmlBasicTextBoxAdapter.cs
- OrthographicCamera.cs
- GridViewSelectEventArgs.cs
- TextAutomationPeer.cs
- TreeViewImageKeyConverter.cs
- StatusBarPanel.cs
- EncryptedPackageFilter.cs
- Freezable.cs
- PageSetupDialog.cs
- ExtensionQuery.cs
- XmlNodeChangedEventArgs.cs
- AppDomainManager.cs
- RegexCode.cs
- FactoryId.cs
- InvalidEnumArgumentException.cs
- SharedStatics.cs
- DataGridViewTopRowAccessibleObject.cs
- IntegrationExceptionEventArgs.cs
- CodeAttributeArgumentCollection.cs
- SolidBrush.cs
- HtmlElementCollection.cs
- ServiceModelConfigurationSection.cs
- TextEditorSelection.cs
- Base64Decoder.cs
- RangeBase.cs
- GetTokenRequest.cs
- EntityCommandDefinition.cs
- MenuItemStyleCollection.cs
- OrderingInfo.cs
- SystemTcpStatistics.cs
- ClusterRegistryConfigurationProvider.cs
- ObjectStateManager.cs
- SpellerHighlightLayer.cs
- RandomNumberGenerator.cs
- RestHandler.cs
- DecoderFallback.cs
- FacetEnabledSchemaElement.cs
- FieldAccessException.cs
- AnonymousIdentificationSection.cs
- HandledMouseEvent.cs
- SplineQuaternionKeyFrame.cs
- OuterGlowBitmapEffect.cs
- TableCellAutomationPeer.cs
- DataColumnCollection.cs
- FixedSOMTable.cs
- ImageDrawing.cs
- WorkflowMessageEventArgs.cs
- configsystem.cs
- RemoveStoryboard.cs
- ExpressionEditorAttribute.cs
- OrderingInfo.cs
- SelectionManager.cs
- DiscoveryServiceExtension.cs