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
- PartialCachingAttribute.cs
- DrawTreeNodeEventArgs.cs
- WebServicesInteroperability.cs
- SqlServer2KCompatibilityCheck.cs
- StylusDownEventArgs.cs
- CompiledRegexRunner.cs
- NativeObjectSecurity.cs
- xsdvalidator.cs
- ConstraintEnumerator.cs
- PropertyManager.cs
- ArgIterator.cs
- XmlSerializationWriter.cs
- ChtmlTextWriter.cs
- SequenceNumber.cs
- PowerModeChangedEventArgs.cs
- OracleCommand.cs
- FrameworkReadOnlyPropertyMetadata.cs
- AnimatedTypeHelpers.cs
- FocusWithinProperty.cs
- HandleExceptionArgs.cs
- Registry.cs
- TrustManagerPromptUI.cs
- TaiwanLunisolarCalendar.cs
- RootBrowserWindowAutomationPeer.cs
- CodeThrowExceptionStatement.cs
- WebReference.cs
- DragDeltaEventArgs.cs
- BamlReader.cs
- BufferedStream.cs
- RoleManagerModule.cs
- StreamResourceInfo.cs
- ByteStorage.cs
- WebPartConnectionsConnectVerb.cs
- Transaction.cs
- ObsoleteAttribute.cs
- FastPropertyAccessor.cs
- SpnEndpointIdentity.cs
- TransactionManager.cs
- XmlSchemaDocumentation.cs
- RegexWorker.cs
- StdValidatorsAndConverters.cs
- DefaultHttpHandler.cs
- WebResponse.cs
- SelectionItemProviderWrapper.cs
- DecodeHelper.cs
- x509utils.cs
- BufferedWebEventProvider.cs
- RelatedPropertyManager.cs
- FileAuthorizationModule.cs
- EntityStoreSchemaGenerator.cs
- SchemaNotation.cs
- ManifestResourceInfo.cs
- UiaCoreProviderApi.cs
- FileLogRecordStream.cs
- AutoResetEvent.cs
- ServiceBehaviorAttribute.cs
- HtmlTableRowCollection.cs
- Unit.cs
- _UriSyntax.cs
- ColorKeyFrameCollection.cs
- XmlSchemaSubstitutionGroup.cs
- MetadataArtifactLoader.cs
- ResizeGrip.cs
- HtmlTernaryTree.cs
- DecimalAnimationUsingKeyFrames.cs
- DragDrop.cs
- AuthenticatingEventArgs.cs
- SynchronizedDisposablePool.cs
- Point3DAnimationBase.cs
- DeclarativeExpressionConditionDeclaration.cs
- RangeValuePattern.cs
- InstallerTypeAttribute.cs
- DataError.cs
- Event.cs
- EncoderParameter.cs
- ContentPresenter.cs
- SqlInternalConnection.cs
- Latin1Encoding.cs
- GPStream.cs
- DataColumnMappingCollection.cs
- GridItemPatternIdentifiers.cs
- Boolean.cs
- XPathSelectionIterator.cs
- UpdateExpressionVisitor.cs
- SqlRowUpdatingEvent.cs
- SessionStateModule.cs
- GlyphRunDrawing.cs
- SessionStateContainer.cs
- ObjectStateFormatter.cs
- FamilyMap.cs
- ObjectStateManagerMetadata.cs
- MetadataItemEmitter.cs
- RemoteCryptoTokenProvider.cs
- ExpressionHelper.cs
- followingquery.cs
- Opcode.cs
- SimpleApplicationHost.cs
- Vector3DConverter.cs
- Column.cs
- SqlDependencyUtils.cs