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
- SqlErrorCollection.cs
- PrintDialog.cs
- XhtmlBasicTextViewAdapter.cs
- SessionViewState.cs
- DescendentsWalker.cs
- EntityDataSourceReferenceGroup.cs
- DescendentsWalkerBase.cs
- IndexingContentUnit.cs
- XmlUtilWriter.cs
- Crypto.cs
- VirtualizingStackPanel.cs
- PeerChannelFactory.cs
- SecureConversationVersion.cs
- OdbcConnectionOpen.cs
- StrokeCollectionDefaultValueFactory.cs
- FacetEnabledSchemaElement.cs
- EntityDataSourceSelectingEventArgs.cs
- SpellerInterop.cs
- SoapSchemaImporter.cs
- ScrollData.cs
- VisualCollection.cs
- MarginCollapsingState.cs
- RequestCachePolicy.cs
- ThousandthOfEmRealPoints.cs
- OdbcConnectionStringbuilder.cs
- ScopelessEnumAttribute.cs
- WebPartRestoreVerb.cs
- SmtpAuthenticationManager.cs
- OdbcCommand.cs
- AddInController.cs
- TextTrailingWordEllipsis.cs
- MailAddressCollection.cs
- XmlSortKeyAccumulator.cs
- RayMeshGeometry3DHitTestResult.cs
- DefinitionUpdate.cs
- EdmPropertyAttribute.cs
- HtmlLabelAdapter.cs
- DiffuseMaterial.cs
- milexports.cs
- NameTable.cs
- WindowsListViewGroupSubsetLink.cs
- storepermissionattribute.cs
- StringValidator.cs
- WebHttpBinding.cs
- CommentAction.cs
- OdbcConnectionString.cs
- RectAnimationUsingKeyFrames.cs
- AddInToken.cs
- PathSegmentCollection.cs
- SineEase.cs
- securitycriticaldataClass.cs
- DrawingBrush.cs
- WebDisplayNameAttribute.cs
- ToolTipAutomationPeer.cs
- ChineseLunisolarCalendar.cs
- CharKeyFrameCollection.cs
- DataControlFieldCollection.cs
- PlainXmlWriter.cs
- DbException.cs
- PolyLineSegment.cs
- TextSearch.cs
- ThicknessAnimationUsingKeyFrames.cs
- DataSetMappper.cs
- PagesSection.cs
- XmlEncApr2001.cs
- FileDialogCustomPlacesCollection.cs
- CommandPlan.cs
- SizeChangedInfo.cs
- PageBuildProvider.cs
- BindingsCollection.cs
- TableItemProviderWrapper.cs
- XmlReaderSettings.cs
- DbTypeMap.cs
- OnOperation.cs
- QilCloneVisitor.cs
- TCEAdapterGenerator.cs
- DummyDataSource.cs
- MobileComponentEditorPage.cs
- HighContrastHelper.cs
- SR.cs
- GradientBrush.cs
- RegexFCD.cs
- Exception.cs
- TdsParserSessionPool.cs
- ConnectionInterfaceCollection.cs
- URLString.cs
- SoundPlayer.cs
- TextFormatterHost.cs
- Help.cs
- TimeIntervalCollection.cs
- WasAdminWrapper.cs
- PageBuildProvider.cs
- EventDescriptorCollection.cs
- EntityDataSourceStatementEditor.cs
- SecurityManager.cs
- ClientRequest.cs
- ButtonFieldBase.cs
- AspCompat.cs
- MainMenu.cs
- XPathNavigatorKeyComparer.cs