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
- EditingCoordinator.cs
- IdentitySection.cs
- DependencySource.cs
- ViewGenResults.cs
- PropertyInformation.cs
- TextBoxBase.cs
- ADMembershipUser.cs
- SecurityContextTokenValidationException.cs
- SchemeSettingElement.cs
- WinHttpWebProxyFinder.cs
- InlineCollection.cs
- AssemblyResourceLoader.cs
- NegationPusher.cs
- XappLauncher.cs
- DataGridViewSortCompareEventArgs.cs
- DynamicDataExtensions.cs
- KeyValuePairs.cs
- ApplicationDirectory.cs
- CodeIterationStatement.cs
- Visual3D.cs
- OutputCacheProviderCollection.cs
- Blend.cs
- InternalEnumValidator.cs
- ArraySegment.cs
- DbTypeMap.cs
- TempFiles.cs
- ResourcePool.cs
- _SingleItemRequestCache.cs
- ClickablePoint.cs
- StringSorter.cs
- XmlTextReaderImplHelpers.cs
- WinOEToolBoxItem.cs
- BinaryFormatter.cs
- WebPartEditorApplyVerb.cs
- QuaternionAnimation.cs
- TimelineGroup.cs
- DataPager.cs
- _ChunkParse.cs
- PageCatalogPart.cs
- QueueProcessor.cs
- InvalidAsynchronousStateException.cs
- ItemDragEvent.cs
- MailSettingsSection.cs
- PageCodeDomTreeGenerator.cs
- CreateParams.cs
- AnimationClock.cs
- DataBoundLiteralControl.cs
- XmlMapping.cs
- PerfService.cs
- AlphaSortedEnumConverter.cs
- PropertyInformationCollection.cs
- PointLight.cs
- DataBoundControlActionList.cs
- StylusDownEventArgs.cs
- TrayIconDesigner.cs
- TypeForwardedToAttribute.cs
- COSERVERINFO.cs
- FtpWebRequest.cs
- QilInvokeEarlyBound.cs
- AppliesToBehaviorDecisionTable.cs
- _Connection.cs
- Graph.cs
- streamingZipPartStream.cs
- XmlChoiceIdentifierAttribute.cs
- Message.cs
- ContextDataSourceContextData.cs
- CodeGeneratorOptions.cs
- ForeignConstraint.cs
- StructuralObject.cs
- DataGridViewCheckBoxColumn.cs
- CombinedTcpChannel.cs
- EventLogRecord.cs
- ThreadStaticAttribute.cs
- CriticalHandle.cs
- IPEndPoint.cs
- SafeNativeMethodsCLR.cs
- Vector3DConverter.cs
- ButtonBase.cs
- XPathScanner.cs
- HttpProfileGroupBase.cs
- NetworkAddressChange.cs
- CodeBlockBuilder.cs
- StylusCaptureWithinProperty.cs
- AutoSizeComboBox.cs
- XmlTextEncoder.cs
- AlphabetConverter.cs
- PassportAuthenticationEventArgs.cs
- NegotiateStream.cs
- FtpCachePolicyElement.cs
- CustomAttribute.cs
- HitTestDrawingContextWalker.cs
- ScrollChrome.cs
- AnnotationAuthorChangedEventArgs.cs
- Util.cs
- GridProviderWrapper.cs
- HttpHandlerActionCollection.cs
- PointLightBase.cs
- SoapAttributes.cs
- Literal.cs
- ExtensionQuery.cs