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
- XhtmlBasicLinkAdapter.cs
- ClrPerspective.cs
- PathFigure.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- CodeTypeDeclaration.cs
- ContractsBCL.cs
- EditCommandColumn.cs
- QueryExpression.cs
- BStrWrapper.cs
- AdRotator.cs
- FunctionDetailsReader.cs
- FontInfo.cs
- ByteStack.cs
- VisualBrush.cs
- Decorator.cs
- ControlCachePolicy.cs
- GeneralTransform3DGroup.cs
- XmlSchemaCollection.cs
- ListViewItemEventArgs.cs
- TextEditorMouse.cs
- DetailsViewInsertedEventArgs.cs
- Effect.cs
- DateTime.cs
- BitmapImage.cs
- ToolStripItemDesigner.cs
- WasAdminWrapper.cs
- TdsParserStaticMethods.cs
- unsafenativemethodstextservices.cs
- PropertyNames.cs
- WindowsListViewSubItem.cs
- ViewBox.cs
- UserPersonalizationStateInfo.cs
- GenericTypeParameterBuilder.cs
- ButtonColumn.cs
- NullableDecimalAverageAggregationOperator.cs
- SqlNodeAnnotation.cs
- DecoderReplacementFallback.cs
- ButtonChrome.cs
- ZeroOpNode.cs
- BackStopAuthenticationModule.cs
- NamedPipeTransportManager.cs
- Input.cs
- Unit.cs
- ToggleProviderWrapper.cs
- WindowsSecurityTokenAuthenticator.cs
- FilterException.cs
- DocumentXmlWriter.cs
- XmlHierarchicalEnumerable.cs
- ByteStreamBufferedMessageData.cs
- CodeMethodReturnStatement.cs
- DriveInfo.cs
- PerfService.cs
- ModelServiceImpl.cs
- DockProviderWrapper.cs
- DetailsViewDeletedEventArgs.cs
- MultipleViewPattern.cs
- ValidatorUtils.cs
- DecoderBestFitFallback.cs
- RegexCharClass.cs
- SafeCryptHandles.cs
- InputBinding.cs
- LongValidator.cs
- UrlPath.cs
- FormatVersion.cs
- UrlAuthFailedErrorFormatter.cs
- OpCellTreeNode.cs
- RectAnimationClockResource.cs
- XPathCompileException.cs
- NominalTypeEliminator.cs
- XmlTextReaderImplHelpers.cs
- WebSysDefaultValueAttribute.cs
- QilInvoke.cs
- DoubleStorage.cs
- CrossContextChannel.cs
- SafeReversePInvokeHandle.cs
- _DisconnectOverlappedAsyncResult.cs
- SmiConnection.cs
- FixedSOMTextRun.cs
- XmlCodeExporter.cs
- ContentPropertyAttribute.cs
- parserscommon.cs
- CredentialCache.cs
- ChtmlSelectionListAdapter.cs
- XmlCharCheckingWriter.cs
- SqlServices.cs
- CultureInfoConverter.cs
- XPathSelectionIterator.cs
- DoubleKeyFrameCollection.cs
- XhtmlTextWriter.cs
- PreviewPrintController.cs
- AgileSafeNativeMemoryHandle.cs
- Reference.cs
- CodeAccessPermission.cs
- UIElementParagraph.cs
- XmlValueConverter.cs
- TargetFrameworkAttribute.cs
- ThemeDirectoryCompiler.cs
- TransformConverter.cs
- NumericUpDown.cs
- SafeUserTokenHandle.cs