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
- XmlDocument.cs
- SecurityDescriptor.cs
- AnimationTimeline.cs
- PasswordPropertyTextAttribute.cs
- URLString.cs
- ExtenderProvidedPropertyAttribute.cs
- PermissionSet.cs
- AutomationIdentifier.cs
- AppSettings.cs
- Form.cs
- HtmlImage.cs
- ResXResourceReader.cs
- ServiceBehaviorAttribute.cs
- TypographyProperties.cs
- ObjectListDataBindEventArgs.cs
- TableDetailsRow.cs
- MimeXmlImporter.cs
- HtmlMeta.cs
- PersianCalendar.cs
- PartialClassGenerationTaskInternal.cs
- AggregationMinMaxHelpers.cs
- WebPartTransformerAttribute.cs
- MetadataProperty.cs
- listitem.cs
- ValidatorUtils.cs
- TypographyProperties.cs
- PanelContainerDesigner.cs
- BitVector32.cs
- InputLanguageEventArgs.cs
- SettingsProviderCollection.cs
- SchemaDeclBase.cs
- SqlTopReducer.cs
- RijndaelCryptoServiceProvider.cs
- WorkItem.cs
- HitTestParameters3D.cs
- NamespaceDecl.cs
- BamlTreeMap.cs
- AccessViolationException.cs
- SerializableAttribute.cs
- Processor.cs
- UserPersonalizationStateInfo.cs
- CompositeCollection.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- RequiredFieldValidator.cs
- WrappedIUnknown.cs
- FilteredXmlReader.cs
- AudioDeviceOut.cs
- ComMethodElementCollection.cs
- QueryInterceptorAttribute.cs
- PkcsMisc.cs
- DependencyObject.cs
- WebPartEditorCancelVerb.cs
- FocusManager.cs
- SystemDropShadowChrome.cs
- DataGridViewColumnEventArgs.cs
- XmlSchemaAttributeGroup.cs
- processwaithandle.cs
- FunctionParameter.cs
- BuilderElements.cs
- EncryptedType.cs
- SimpleWebHandlerParser.cs
- HideDisabledControlAdapter.cs
- LocationReferenceEnvironment.cs
- SspiWrapper.cs
- Calendar.cs
- DocumentViewerBase.cs
- CharacterBuffer.cs
- WorkflowRuntimeElement.cs
- ExceptionList.cs
- Rectangle.cs
- MetadataCollection.cs
- SourceChangedEventArgs.cs
- ToolboxItemCollection.cs
- webeventbuffer.cs
- ChtmlPageAdapter.cs
- webproxy.cs
- ZipIOExtraField.cs
- ShaperBuffers.cs
- ToolZone.cs
- ImageInfo.cs
- SessionPageStateSection.cs
- IconConverter.cs
- HostSecurityManager.cs
- DataServicePagingProviderWrapper.cs
- UnsafeNativeMethods.cs
- XmlQueryTypeFactory.cs
- SoapExtensionReflector.cs
- DefaultProxySection.cs
- ParenthesizePropertyNameAttribute.cs
- ComponentDesigner.cs
- DebugView.cs
- InteropBitmapSource.cs
- ToolStripSeparatorRenderEventArgs.cs
- VirtualizingPanel.cs
- OrderedDictionary.cs
- DirectoryInfo.cs
- MaterializeFromAtom.cs
- UInt64.cs
- EventLogPermissionEntry.cs
- RoutedEvent.cs