Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- PackageRelationshipSelector.cs
- MsmqMessage.cs
- IndexerNameAttribute.cs
- TextAutomationPeer.cs
- RadioButtonBaseAdapter.cs
- QuotedPrintableStream.cs
- Events.cs
- ToolStripDropDownItem.cs
- RankException.cs
- VScrollProperties.cs
- SortFieldComparer.cs
- SubMenuStyle.cs
- UrlPath.cs
- thaishape.cs
- MediaContextNotificationWindow.cs
- CancelEventArgs.cs
- UnknownBitmapEncoder.cs
- LabelAutomationPeer.cs
- ServiceProviders.cs
- IndentedWriter.cs
- ScriptBehaviorDescriptor.cs
- ProcessInputEventArgs.cs
- LogicalExpr.cs
- PerformanceCountersElement.cs
- InputReport.cs
- XmlSchemaAll.cs
- ListViewEditEventArgs.cs
- ComponentCollection.cs
- TabItemAutomationPeer.cs
- SspiWrapper.cs
- PerfCounters.cs
- PrtCap_Reader.cs
- BindingsCollection.cs
- XmlNamespaceMappingCollection.cs
- SourceInterpreter.cs
- DataBindingCollection.cs
- CodeTypeParameter.cs
- CommunicationObjectManager.cs
- EndpointInfoCollection.cs
- RowUpdatedEventArgs.cs
- mansign.cs
- ResourceSet.cs
- MailDefinition.cs
- NativeMethods.cs
- CqlErrorHelper.cs
- BaseComponentEditor.cs
- CompositeDuplexBindingElementImporter.cs
- ElementMarkupObject.cs
- AdornerDecorator.cs
- AppearanceEditorPart.cs
- SymLanguageVendor.cs
- TdsParser.cs
- BitmapSourceSafeMILHandle.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- FormsAuthenticationModule.cs
- Lock.cs
- HostedTransportConfigurationManager.cs
- TextTreeNode.cs
- SqlDependency.cs
- RoleManagerEventArgs.cs
- WebMessageFormatHelper.cs
- ComplexLine.cs
- Peer.cs
- XmlEventCache.cs
- GatewayDefinition.cs
- SupportsEventValidationAttribute.cs
- HtmlAnchor.cs
- OleDbErrorCollection.cs
- DataGridCommandEventArgs.cs
- StreamReader.cs
- RecognitionEventArgs.cs
- MarkupCompiler.cs
- Int32CollectionConverter.cs
- FillRuleValidation.cs
- EntityDataSourceWrapperCollection.cs
- SByteConverter.cs
- __TransparentProxy.cs
- Parameter.cs
- UserControlBuildProvider.cs
- RightsManagementInformation.cs
- DataReceivedEventArgs.cs
- mil_commands.cs
- MultipleViewPatternIdentifiers.cs
- UrlMappingsSection.cs
- Int32AnimationBase.cs
- SerialErrors.cs
- DynamicValidator.cs
- Helper.cs
- CommentEmitter.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- TypeDescriptionProviderAttribute.cs
- ViewSimplifier.cs
- RenamedEventArgs.cs
- MessageDescriptionCollection.cs
- RIPEMD160.cs
- ComponentManagerBroker.cs
- FixedSOMImage.cs
- BackStopAuthenticationModule.cs
- LogicalTreeHelper.cs
- TypeDescriptionProviderAttribute.cs