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
- RepeaterItemCollection.cs
- ObjectViewQueryResultData.cs
- AstNode.cs
- EdmProviderManifest.cs
- AssemblyAttributes.cs
- LassoSelectionBehavior.cs
- PathFigureCollection.cs
- HandlerBase.cs
- ContractAdapter.cs
- Synchronization.cs
- FunctionImportElement.cs
- HTTPRemotingHandler.cs
- BehaviorEditorPart.cs
- HandlerMappingMemo.cs
- WebPartTransformerCollection.cs
- PhoneCallDesigner.cs
- CaretElement.cs
- DBCSCodePageEncoding.cs
- HtmlButton.cs
- ItemCheckedEvent.cs
- InstanceLockException.cs
- CheckBoxPopupAdapter.cs
- QualifiedCellIdBoolean.cs
- Vars.cs
- BrowserPolicyValidator.cs
- DefaultDiscoveryService.cs
- TextSelection.cs
- ClientFormsIdentity.cs
- ProgressChangedEventArgs.cs
- ResourceSet.cs
- HostedTransportConfigurationManager.cs
- MdiWindowListStrip.cs
- Send.cs
- PenThreadPool.cs
- URLAttribute.cs
- StorageTypeMapping.cs
- SpellerError.cs
- Int16AnimationBase.cs
- ToolStripGripRenderEventArgs.cs
- WpfKnownMemberInvoker.cs
- MimeParameter.cs
- ReachDocumentSequenceSerializer.cs
- ResourceSet.cs
- Font.cs
- HostedTcpTransportManager.cs
- SelectedCellsCollection.cs
- SQLStringStorage.cs
- XmlSchemaSearchPattern.cs
- RuleEngine.cs
- LinqDataSourceSelectEventArgs.cs
- XmlSchemaAnnotated.cs
- RequestContext.cs
- newinstructionaction.cs
- RewritingValidator.cs
- GridViewUpdateEventArgs.cs
- HMACSHA512.cs
- ToolStripPanelCell.cs
- DbDataReader.cs
- CreateRefExpr.cs
- Int16.cs
- PhoneCallDesigner.cs
- SqlBulkCopyColumnMappingCollection.cs
- CellTreeNode.cs
- HtmlTernaryTree.cs
- PrimitiveXmlSerializers.cs
- Vector3DKeyFrameCollection.cs
- NotConverter.cs
- IChannel.cs
- LongSumAggregationOperator.cs
- DataControlCommands.cs
- PageVisual.cs
- Util.cs
- PlanCompiler.cs
- QilGenerator.cs
- XmlSchemas.cs
- XmlUtil.cs
- MeshGeometry3D.cs
- HostingEnvironmentException.cs
- AppearanceEditorPart.cs
- AssociationEndMember.cs
- ToolStripHighContrastRenderer.cs
- DependencyPropertyKey.cs
- KeyGestureConverter.cs
- SendKeys.cs
- SQLInt16.cs
- ConfigurationManagerInternal.cs
- SymDocumentType.cs
- InternalControlCollection.cs
- Geometry.cs
- WebPartConnectVerb.cs
- WebPartConnectionsCloseVerb.cs
- WebServiceErrorEvent.cs
- ClipboardData.cs
- MetadataSerializer.cs
- BitmapEffectInput.cs
- WebPartConnectionsDisconnectVerb.cs
- DataBoundLiteralControl.cs
- CoTaskMemUnicodeSafeHandle.cs
- SqlTriggerAttribute.cs
- ReferencedCollectionType.cs