Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- BitmapEffectDrawingContextWalker.cs
- FullTextBreakpoint.cs
- precedingquery.cs
- EventData.cs
- OracleBinary.cs
- NavigationProperty.cs
- FileEnumerator.cs
- DesignerOptionService.cs
- EntityDataSourceDesigner.cs
- OperatorExpressions.cs
- BackgroundWorker.cs
- DelegateBodyWriter.cs
- bidPrivateBase.cs
- MimeXmlReflector.cs
- TimeIntervalCollection.cs
- DesignerHelpers.cs
- ObjectListFieldsPage.cs
- DataRowChangeEvent.cs
- ReliableSessionBindingElementImporter.cs
- XmlUtf8RawTextWriter.cs
- Polygon.cs
- OperationExecutionFault.cs
- MaskedTextProvider.cs
- ToolstripProfessionalRenderer.cs
- UIElement.cs
- ObjectReferenceStack.cs
- SerialErrors.cs
- WindowsEditBoxRange.cs
- WindowsComboBox.cs
- SystemIPv6InterfaceProperties.cs
- SafeCancelMibChangeNotify.cs
- IconHelper.cs
- TextProperties.cs
- WaitHandleCannotBeOpenedException.cs
- RecognizerStateChangedEventArgs.cs
- RegexReplacement.cs
- WindowsProgressbar.cs
- ReferenceSchema.cs
- ToolBar.cs
- TableItemPatternIdentifiers.cs
- GridViewDeletedEventArgs.cs
- SqlVersion.cs
- Serializer.cs
- UnmanagedMemoryStream.cs
- Journaling.cs
- GC.cs
- EmissiveMaterial.cs
- MyContact.cs
- ReadOnlyNameValueCollection.cs
- TempEnvironment.cs
- SingleResultAttribute.cs
- DependencyProperty.cs
- ListBindingHelper.cs
- Enlistment.cs
- TextMarkerSource.cs
- ContainsSearchOperator.cs
- DesignerTransactionCloseEvent.cs
- HierarchicalDataBoundControlAdapter.cs
- CodeDOMProvider.cs
- RunInstallerAttribute.cs
- ScaleTransform.cs
- odbcmetadatacolumnnames.cs
- ConfigurationStrings.cs
- MachinePropertyVariants.cs
- DBAsyncResult.cs
- selecteditemcollection.cs
- COM2ExtendedBrowsingHandler.cs
- UserControl.cs
- returneventsaver.cs
- EventDescriptor.cs
- WSSecureConversation.cs
- XmlLinkedNode.cs
- ImageListStreamer.cs
- DbProviderFactory.cs
- StaticSiteMapProvider.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- dataprotectionpermission.cs
- ContentType.cs
- HMACRIPEMD160.cs
- FileDialog.cs
- ByteAnimationUsingKeyFrames.cs
- LambdaCompiler.Expressions.cs
- _UriTypeConverter.cs
- FeatureSupport.cs
- ConfigXmlComment.cs
- PermissionSetEnumerator.cs
- Compensate.cs
- IFlowDocumentViewer.cs
- TimeSpanValidatorAttribute.cs
- SelectionHighlightInfo.cs
- NameValueSectionHandler.cs
- TraceLog.cs
- AutomationElement.cs
- ThrowHelper.cs
- OperationDescription.cs
- SingleAnimationUsingKeyFrames.cs
- DecimalMinMaxAggregationOperator.cs
- CompoundFileIOPermission.cs
- SkewTransform.cs
- VerificationAttribute.cs