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
- WpfPayload.cs
- XsltSettings.cs
- ServicesExceptionNotHandledEventArgs.cs
- ConnectionStringSettingsCollection.cs
- DataGridViewAccessibleObject.cs
- CounterCreationData.cs
- CalendarAutoFormatDialog.cs
- AccessText.cs
- XmlMapping.cs
- XmlIlGenerator.cs
- StreamUpdate.cs
- RemoteWebConfigurationHostServer.cs
- CodeArgumentReferenceExpression.cs
- ExtendedPropertyCollection.cs
- CompiledQueryCacheEntry.cs
- XsltSettings.cs
- DocumentSchemaValidator.cs
- PreviewKeyDownEventArgs.cs
- FileUtil.cs
- HtmlInputPassword.cs
- DelegateHelpers.Generated.cs
- typedescriptorpermission.cs
- TrackingMemoryStream.cs
- DependencyPropertyConverter.cs
- StatusBarPanelClickEvent.cs
- DataGridViewIntLinkedList.cs
- CompositeActivityValidator.cs
- EncoderExceptionFallback.cs
- wmiprovider.cs
- storagemappingitemcollection.viewdictionary.cs
- SqlCommandBuilder.cs
- LayoutTable.cs
- _NestedSingleAsyncResult.cs
- BuildProvider.cs
- SchemaMapping.cs
- Rotation3DAnimation.cs
- Security.cs
- ConnectionString.cs
- QilNode.cs
- TargetParameterCountException.cs
- QilInvoke.cs
- IntSecurity.cs
- EventWaitHandle.cs
- pingexception.cs
- LayoutTable.cs
- EmptyStringExpandableObjectConverter.cs
- HeaderLabel.cs
- Transform3DCollection.cs
- SqlDataReader.cs
- CompositeFontFamily.cs
- NativeMethods.cs
- DataObject.cs
- SamlAttribute.cs
- Mapping.cs
- RegexCharClass.cs
- ChildrenQuery.cs
- PropertyKey.cs
- BrushMappingModeValidation.cs
- SoapSchemaExporter.cs
- ObsoleteAttribute.cs
- QilStrConcatenator.cs
- StagingAreaInputItem.cs
- COM2Enum.cs
- BitSet.cs
- WebPartChrome.cs
- XmlDataProvider.cs
- XmlTextReaderImpl.cs
- EditorAttribute.cs
- DoubleLinkListEnumerator.cs
- HttpApplicationFactory.cs
- ResourceAssociationType.cs
- KeyboardEventArgs.cs
- FormViewPagerRow.cs
- IndexerNameAttribute.cs
- PictureBox.cs
- SharedStatics.cs
- DataGridTableStyleMappingNameEditor.cs
- EntityProxyTypeInfo.cs
- AutomationTextAttribute.cs
- Quad.cs
- PageThemeParser.cs
- WebPartConnectionsCloseVerb.cs
- DetailsView.cs
- ControlCollection.cs
- BooleanToVisibilityConverter.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- DebuggerAttributes.cs
- TraceInternal.cs
- TraceRecord.cs
- BindingMemberInfo.cs
- XamlPointCollectionSerializer.cs
- TextParagraphProperties.cs
- PathSegmentCollection.cs
- GenericUriParser.cs
- shaperfactoryquerycacheentry.cs
- RtType.cs
- BitConverter.cs
- storepermissionattribute.cs
- SchemaTableColumn.cs
- ManagedCodeMarkers.cs