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
- DataGridViewCellLinkedList.cs
- InvalidPrinterException.cs
- TextReader.cs
- TreeWalker.cs
- AddDataControlFieldDialog.cs
- uribuilder.cs
- References.cs
- sqlnorm.cs
- BaseUriHelper.cs
- OleDbPermission.cs
- ProcessHostConfigUtils.cs
- PresentationAppDomainManager.cs
- DtrList.cs
- ServerIdentity.cs
- PartialToken.cs
- Boolean.cs
- HttpDigestClientCredential.cs
- Geometry.cs
- DesignerSerializationOptionsAttribute.cs
- ClientEventManager.cs
- RuntimeConfig.cs
- TemplateBuilder.cs
- NullableIntMinMaxAggregationOperator.cs
- DateTimeFormatInfoScanner.cs
- _ProxyRegBlob.cs
- ServiceOperationUIEditor.cs
- SendKeys.cs
- CodeCommentStatementCollection.cs
- XmlObjectSerializerWriteContextComplex.cs
- Int64Storage.cs
- Literal.cs
- LinqDataSourceDisposeEventArgs.cs
- HtmlImage.cs
- IgnoreSection.cs
- TargetControlTypeAttribute.cs
- XmlILModule.cs
- MarkupProperty.cs
- CompiledXpathExpr.cs
- MulticastDelegate.cs
- TextRangeEditTables.cs
- StylusDevice.cs
- KeyPressEvent.cs
- PageFunction.cs
- ContentDisposition.cs
- XmlSchemaGroup.cs
- Nodes.cs
- SessionPageStatePersister.cs
- ParseChildrenAsPropertiesAttribute.cs
- DynamicDiscoSearcher.cs
- ProgressBarRenderer.cs
- DiscoveryInnerClientManaged11.cs
- Funcletizer.cs
- SimpleWebHandlerParser.cs
- OciLobLocator.cs
- Point3DKeyFrameCollection.cs
- _ChunkParse.cs
- HtmlTextArea.cs
- CompositeCollectionView.cs
- IfAction.cs
- RecoverInstanceLocksCommand.cs
- DataKeyCollection.cs
- HandlerBase.cs
- CallSiteOps.cs
- SoapElementAttribute.cs
- AsyncOperationContext.cs
- WsatServiceCertificate.cs
- SerializationInfoEnumerator.cs
- ResourceDictionaryCollection.cs
- DetailsViewAutoFormat.cs
- WindowsFormsLinkLabel.cs
- VBIdentifierName.cs
- PropertyGridDesigner.cs
- EntityContainerRelationshipSet.cs
- InstanceDescriptor.cs
- DatatypeImplementation.cs
- BufferedGenericXmlSecurityToken.cs
- NamespaceEmitter.cs
- SelectionListDesigner.cs
- Pkcs9Attribute.cs
- UInt64Storage.cs
- LocalTransaction.cs
- Effect.cs
- DelegatingConfigHost.cs
- ExtensionSurface.cs
- FixedSOMElement.cs
- HTTPNotFoundHandler.cs
- UpdatePanelTriggerCollection.cs
- XmlSchemaComplexContentExtension.cs
- ToolStripDropTargetManager.cs
- Shape.cs
- UnsafeNativeMethods.cs
- WebPartUtil.cs
- TableCellCollection.cs
- ObjectNotFoundException.cs
- AlternationConverter.cs
- BindingListCollectionView.cs
- FileDialogCustomPlacesCollection.cs
- RadioButtonDesigner.cs
- TdsParameterSetter.cs
- StringUtil.cs