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
- SecurityTokenSerializer.cs
- HashJoinQueryOperatorEnumerator.cs
- TextAction.cs
- InvokeWebServiceDesigner.cs
- WorkflowDispatchContext.cs
- StrongNameMembershipCondition.cs
- ThreadAbortException.cs
- PersianCalendar.cs
- CodeAccessSecurityEngine.cs
- Merger.cs
- SystemFonts.cs
- WebPartAddingEventArgs.cs
- GAC.cs
- ControlBindingsCollection.cs
- TraceData.cs
- CodeRemoveEventStatement.cs
- DataColumnMappingCollection.cs
- RewritingSimplifier.cs
- GPRECT.cs
- SimpleType.cs
- SqlRetyper.cs
- OleDbPropertySetGuid.cs
- Utils.cs
- NameTable.cs
- GPRECT.cs
- XamlTypeMapper.cs
- NativeMethods.cs
- DBSchemaTable.cs
- MenuItem.cs
- UnSafeCharBuffer.cs
- CodeTypeDeclarationCollection.cs
- PerformanceCounterPermission.cs
- JsonEncodingStreamWrapper.cs
- RenderData.cs
- Array.cs
- EntityTemplateFactory.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- ConfigXmlCDataSection.cs
- StrokeRenderer.cs
- ObjectTag.cs
- MultipartIdentifier.cs
- EventProviderClassic.cs
- DelegatingTypeDescriptionProvider.cs
- Slider.cs
- PackageFilter.cs
- RtfControls.cs
- ReflectionServiceProvider.cs
- IOException.cs
- UnsafeNativeMethods.cs
- ScriptingRoleServiceSection.cs
- AppDomainShutdownMonitor.cs
- WebEventTraceProvider.cs
- InvalidOleVariantTypeException.cs
- HtmlInputCheckBox.cs
- FullTextState.cs
- VirtualPathProvider.cs
- AttachInfo.cs
- FilteredReadOnlyMetadataCollection.cs
- ResXFileRef.cs
- CachedFontFamily.cs
- Stylesheet.cs
- MarkupCompilePass1.cs
- BaseDataList.cs
- PartialCachingControl.cs
- ObjectQuery.cs
- BaseParser.cs
- TransformerConfigurationWizardBase.cs
- BitmapSourceSafeMILHandle.cs
- KeyboardNavigation.cs
- ControlBuilder.cs
- DataTable.cs
- XmlSchemaAnyAttribute.cs
- Parser.cs
- TimelineCollection.cs
- ClipboardProcessor.cs
- PlacementWorkspace.cs
- XmlCustomFormatter.cs
- XmlnsDictionary.cs
- WindowProviderWrapper.cs
- StringReader.cs
- PolicyException.cs
- FormViewPagerRow.cs
- ActionMessageFilter.cs
- XmlBinaryReader.cs
- HierarchicalDataBoundControlAdapter.cs
- SafeNativeMethods.cs
- LicFileLicenseProvider.cs
- ClassDataContract.cs
- BinaryFormatter.cs
- BrushValueSerializer.cs
- FileEnumerator.cs
- GroupBox.cs
- PenContexts.cs
- OpacityConverter.cs
- XmlTextEncoder.cs
- ReaderOutput.cs
- FlowDocument.cs
- LinkConverter.cs
- Viewport3DVisual.cs
- SafeHandle.cs