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
- SecurityManager.cs
- ItemsPresenter.cs
- MonikerBuilder.cs
- XmlComment.cs
- SystemTcpStatistics.cs
- CurrentChangedEventManager.cs
- CustomErrorsSection.cs
- MissingSatelliteAssemblyException.cs
- ArithmeticException.cs
- _DigestClient.cs
- AuthenticatedStream.cs
- SystemIPGlobalStatistics.cs
- ChangePassword.cs
- Globals.cs
- AsymmetricSignatureFormatter.cs
- QueryCacheManager.cs
- Form.cs
- CodeTryCatchFinallyStatement.cs
- SqlMethodCallConverter.cs
- RunWorkerCompletedEventArgs.cs
- VirtualizedItemProviderWrapper.cs
- MobileControlsSectionHandler.cs
- AddInServer.cs
- StructuralComparisons.cs
- ContentValidator.cs
- ThreadStateException.cs
- InnerItemCollectionView.cs
- XmlSchemaElement.cs
- TextCharacters.cs
- OracleSqlParser.cs
- BevelBitmapEffect.cs
- ResourceDisplayNameAttribute.cs
- NativeMethods.cs
- FormatConvertedBitmap.cs
- VectorValueSerializer.cs
- MatrixAnimationUsingPath.cs
- CategoryAttribute.cs
- BaseUriHelper.cs
- AncillaryOps.cs
- ModelPropertyDescriptor.cs
- DataSourceNameHandler.cs
- PropertyMappingExceptionEventArgs.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- XmlSerializerFactory.cs
- DataGridViewColumnStateChangedEventArgs.cs
- FontFamilyIdentifier.cs
- OleDbPermission.cs
- ObjectQuery.cs
- TextEditorDragDrop.cs
- InputBinding.cs
- SQLSingleStorage.cs
- ArgumentNullException.cs
- _Semaphore.cs
- VisualStateManager.cs
- HtmlLinkAdapter.cs
- dbenumerator.cs
- CheckableControlBaseAdapter.cs
- ContentDisposition.cs
- DataObject.cs
- TcpTransportSecurityElement.cs
- PersonalizableAttribute.cs
- UnlockCardRequest.cs
- ServiceXNameTypeConverter.cs
- DataObject.cs
- FormatterServices.cs
- DrawItemEvent.cs
- PerformanceCounterPermissionEntryCollection.cs
- DynamicActivity.cs
- RegexCompiler.cs
- storagemappingitemcollection.viewdictionary.cs
- PageWrapper.cs
- ServiceReference.cs
- Normalization.cs
- Graphics.cs
- XmlDataSourceView.cs
- ErrorHandler.cs
- StagingAreaInputItem.cs
- SubclassTypeValidatorAttribute.cs
- ElementNotAvailableException.cs
- AssemblyFilter.cs
- TextAction.cs
- GroupItem.cs
- ShaderEffect.cs
- DataMemberAttribute.cs
- CorruptStoreException.cs
- ResourceAttributes.cs
- NotificationContext.cs
- StretchValidation.cs
- PageContentAsyncResult.cs
- DES.cs
- PenThreadPool.cs
- HandlerWithFactory.cs
- BitmapCacheBrush.cs
- FixedPosition.cs
- TimeZone.cs
- AspNetHostingPermission.cs
- BinarySerializer.cs
- DataGridPagerStyle.cs
- ImageMapEventArgs.cs
- BinaryObjectInfo.cs