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
- ApplicationException.cs
- MailHeaderInfo.cs
- FileStream.cs
- EventBookmark.cs
- StateElementCollection.cs
- IdnMapping.cs
- FtpCachePolicyElement.cs
- IgnoreDataMemberAttribute.cs
- PackagingUtilities.cs
- TreeNodeStyleCollectionEditor.cs
- CategoryNameCollection.cs
- IndicFontClient.cs
- Group.cs
- FrameworkTextComposition.cs
- LongSumAggregationOperator.cs
- SettingsSection.cs
- ThicknessAnimation.cs
- TextRangeEdit.cs
- FastPropertyAccessor.cs
- XmlElementAttribute.cs
- UndirectedGraph.cs
- ActivityTypeDesigner.xaml.cs
- HttpCacheParams.cs
- LogSwitch.cs
- ToolStripDropTargetManager.cs
- COAUTHIDENTITY.cs
- ButtonChrome.cs
- FileDialogCustomPlacesCollection.cs
- FixUp.cs
- StructuralObject.cs
- LocatorPart.cs
- EventBuilder.cs
- ToolStripPanelRenderEventArgs.cs
- RNGCryptoServiceProvider.cs
- RoleManagerSection.cs
- ReferenceEqualityComparer.cs
- RuleCache.cs
- SqlRewriteScalarSubqueries.cs
- CodeAccessSecurityEngine.cs
- FixedSOMFixedBlock.cs
- ExpandCollapseProviderWrapper.cs
- TableCell.cs
- DataServiceExpressionVisitor.cs
- XmlNavigatorStack.cs
- RuntimeCompatibilityAttribute.cs
- CaseInsensitiveOrdinalStringComparer.cs
- DefaultMemberAttribute.cs
- FunctionDetailsReader.cs
- GridItem.cs
- WhitespaceRuleReader.cs
- DrawingDrawingContext.cs
- Queue.cs
- DbParameterCollectionHelper.cs
- AnimationClockResource.cs
- HelpProvider.cs
- InputMethodStateTypeInfo.cs
- SendingRequestEventArgs.cs
- XmlQueryRuntime.cs
- EmptyStringExpandableObjectConverter.cs
- SplitterCancelEvent.cs
- ClientTargetCollection.cs
- EventLogTraceListener.cs
- SqlClientWrapperSmiStreamChars.cs
- SessionStateUtil.cs
- SapiRecognizer.cs
- SwitchAttribute.cs
- SqlDataSourceView.cs
- ParenthesizePropertyNameAttribute.cs
- ReadOnlyDictionary.cs
- IFlowDocumentViewer.cs
- OracleMonthSpan.cs
- AxisAngleRotation3D.cs
- DataGridViewColumnHeaderCell.cs
- FacetValues.cs
- ISAPIApplicationHost.cs
- CustomErrorsSection.cs
- ProviderCollection.cs
- RenderContext.cs
- ReadOnlyHierarchicalDataSource.cs
- NegatedConstant.cs
- ColorMatrix.cs
- WebPartZoneBaseDesigner.cs
- Button.cs
- DocobjHost.cs
- FixedSOMElement.cs
- TrustLevel.cs
- SqlLiftIndependentRowExpressions.cs
- SecureUICommand.cs
- CFStream.cs
- XmlSchemaAppInfo.cs
- XmlSchemaElement.cs
- Cursors.cs
- UnsafePeerToPeerMethods.cs
- streamingZipPartStream.cs
- DataGridParentRows.cs
- Animatable.cs
- ImportCatalogPart.cs
- XmlCharCheckingReader.cs
- EntityStoreSchemaFilterEntry.cs
- TemplateAction.cs