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
- MessageDecoder.cs
- TableLayoutStyle.cs
- HttpDigestClientCredential.cs
- KeyValuePairs.cs
- PolicyStatement.cs
- HttpVersion.cs
- MetadataItemCollectionFactory.cs
- SmiEventStream.cs
- ProcessModuleCollection.cs
- HwndAppCommandInputProvider.cs
- StreamResourceInfo.cs
- EngineSiteSapi.cs
- UIElement3DAutomationPeer.cs
- SectionVisual.cs
- TransformedBitmap.cs
- WpfKnownTypeInvoker.cs
- DocumentReferenceCollection.cs
- SchemaImporter.cs
- SpellerError.cs
- WindowsRegion.cs
- MultiDataTrigger.cs
- RemotingService.cs
- ContainsRowNumberChecker.cs
- Regex.cs
- MD5Cng.cs
- KerberosReceiverSecurityToken.cs
- HttpProcessUtility.cs
- QilParameter.cs
- OneWayElement.cs
- OdbcConnectionStringbuilder.cs
- ViewStateException.cs
- SurrogateEncoder.cs
- StyleReferenceConverter.cs
- PathFigureCollection.cs
- Visual3DCollection.cs
- DbProviderConfigurationHandler.cs
- MimeTypeMapper.cs
- PageAsyncTaskManager.cs
- UndoUnit.cs
- DataGridViewImageCell.cs
- BasicBrowserDialog.cs
- OleDbParameter.cs
- CollectionEditor.cs
- AssertValidation.cs
- LinearQuaternionKeyFrame.cs
- RunWorkerCompletedEventArgs.cs
- TextFormatterHost.cs
- TextElementCollection.cs
- NamedPermissionSet.cs
- DesignerLabelAdapter.cs
- columnmapkeybuilder.cs
- EmptyEnumerator.cs
- RijndaelManagedTransform.cs
- WindowsBrush.cs
- HttpWebResponse.cs
- TextDpi.cs
- Utilities.cs
- PrimitiveCodeDomSerializer.cs
- ToolboxDataAttribute.cs
- InputReport.cs
- ClientTargetSection.cs
- WSSecurityXXX2005.cs
- SerializableAttribute.cs
- WindowsMenu.cs
- ListControlBoundActionList.cs
- XmlSchemaDocumentation.cs
- RemotingSurrogateSelector.cs
- CustomError.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- CodeSubDirectoriesCollection.cs
- HttpValueCollection.cs
- CodeArgumentReferenceExpression.cs
- DataGridPagerStyle.cs
- bidPrivateBase.cs
- TreeNodeSelectionProcessor.cs
- SqlConnectionManager.cs
- LayoutTable.cs
- ComponentEditorForm.cs
- LoginCancelEventArgs.cs
- SystemResourceHost.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- CaseExpr.cs
- ProgressBarAutomationPeer.cs
- XmlSchemaAttributeGroup.cs
- QuaternionAnimationUsingKeyFrames.cs
- TimestampInformation.cs
- DefaultAuthorizationContext.cs
- QilTypeChecker.cs
- _NegotiateClient.cs
- BitmapInitialize.cs
- DataMemberFieldConverter.cs
- WebPartsPersonalizationAuthorization.cs
- EventPropertyMap.cs
- WindowShowOrOpenTracker.cs
- CodeCompileUnit.cs
- HttpTransportElement.cs
- WorkflowServiceHostFactory.cs
- EncoderBestFitFallback.cs
- ToolStripMenuItemDesigner.cs
- BaseTemplateCodeDomTreeGenerator.cs