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
- WebScriptMetadataMessageEncoderFactory.cs
- DataContractSerializerSection.cs
- MimeMultiPart.cs
- ImageBrush.cs
- DynamicAttribute.cs
- ClientProxyGenerator.cs
- ManifestBasedResourceGroveler.cs
- OleDbException.cs
- CollaborationHelperFunctions.cs
- ProviderConnectionPoint.cs
- IntegerValidator.cs
- SingleQueryOperator.cs
- StylesEditorDialog.cs
- bidPrivateBase.cs
- MimeParameters.cs
- Automation.cs
- EventLogEntry.cs
- ListControl.cs
- DesignerDataParameter.cs
- UnmanagedBitmapWrapper.cs
- HttpContext.cs
- EntityDataSourceDesignerHelper.cs
- CachedPathData.cs
- IISUnsafeMethods.cs
- Page.cs
- ListViewInsertEventArgs.cs
- PublisherIdentityPermission.cs
- DefaultValueConverter.cs
- ClientUrlResolverWrapper.cs
- EntityContainerEmitter.cs
- SpecularMaterial.cs
- NativeRecognizer.cs
- KeyedPriorityQueue.cs
- TextPointer.cs
- DynamicMetaObject.cs
- ContentElement.cs
- LZCodec.cs
- XmlIlTypeHelper.cs
- PolyQuadraticBezierSegment.cs
- XhtmlBasicLiteralTextAdapter.cs
- GridViewCancelEditEventArgs.cs
- WindowProviderWrapper.cs
- WebServiceMethodData.cs
- ControlPropertyNameConverter.cs
- BackoffTimeoutHelper.cs
- MenuTracker.cs
- XmlCodeExporter.cs
- EncoderNLS.cs
- FixedBufferAttribute.cs
- SqlCrossApplyToCrossJoin.cs
- MsmqIntegrationBindingCollectionElement.cs
- BinaryExpression.cs
- ColorKeyFrameCollection.cs
- ClientSettingsStore.cs
- Mouse.cs
- FontCacheUtil.cs
- XXXOnTypeBuilderInstantiation.cs
- XmlText.cs
- ImageCreator.cs
- TextBox.cs
- RootDesignerSerializerAttribute.cs
- InvalidCastException.cs
- DSACryptoServiceProvider.cs
- ToolStripInSituService.cs
- ConfigUtil.cs
- SchemaImporterExtensionElementCollection.cs
- MessageSmuggler.cs
- DataStreamFromComStream.cs
- Metadata.cs
- Size.cs
- QfeChecker.cs
- WmpBitmapDecoder.cs
- ExpressionConverter.cs
- GroupStyle.cs
- BindingBase.cs
- Vector3dCollection.cs
- EventLog.cs
- HtmlInputImage.cs
- BaseProcessProtocolHandler.cs
- HttpEncoder.cs
- CompositeControl.cs
- WebPartConnectionsDisconnectVerb.cs
- SmtpClient.cs
- ToolBarButton.cs
- AssociativeAggregationOperator.cs
- UIElementCollection.cs
- RegexInterpreter.cs
- IndentedTextWriter.cs
- LocationInfo.cs
- QuaternionRotation3D.cs
- UpdateCommandGenerator.cs
- ValidationResult.cs
- QilReplaceVisitor.cs
- ResourceExpressionBuilder.cs
- TemplateField.cs
- SmtpNtlmAuthenticationModule.cs
- XsdDataContractImporter.cs
- control.ime.cs
- DataRecordInternal.cs
- DesignerActionPropertyItem.cs