Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- SchemaSetCompiler.cs
- XPathItem.cs
- StrongNameMembershipCondition.cs
- WebEvents.cs
- LoadRetryAsyncResult.cs
- ProgressChangedEventArgs.cs
- ApplicationManager.cs
- ShaderEffect.cs
- TableLayoutStyle.cs
- RuleDefinitions.cs
- MsmqHostedTransportConfiguration.cs
- TypefaceMetricsCache.cs
- TypeResolvingOptions.cs
- RTLAwareMessageBox.cs
- BindingValueChangedEventArgs.cs
- TextDocumentView.cs
- ShaperBuffers.cs
- CorrelationService.cs
- SqlBulkCopyColumnMappingCollection.cs
- ProtocolsConfigurationHandler.cs
- TraceHandlerErrorFormatter.cs
- shaperfactory.cs
- relpropertyhelper.cs
- SystemIPInterfaceProperties.cs
- ParseElement.cs
- DiffuseMaterial.cs
- FontUnitConverter.cs
- SafeNativeMethods.cs
- CodeExporter.cs
- MessageDescriptionCollection.cs
- SqlDependency.cs
- UnauthorizedWebPart.cs
- CollectionType.cs
- AudioDeviceOut.cs
- HttpPostedFile.cs
- DecimalKeyFrameCollection.cs
- ToolStripDropDown.cs
- SystemIPInterfaceProperties.cs
- FormViewActionList.cs
- _AcceptOverlappedAsyncResult.cs
- XmlKeywords.cs
- ValidationSettings.cs
- InstalledFontCollection.cs
- KerberosRequestorSecurityToken.cs
- KeyboardEventArgs.cs
- PathSegmentCollection.cs
- SqlDataSourceConfigureSortForm.cs
- EntityDataSourceDesignerHelper.cs
- Int64Storage.cs
- ImageCodecInfo.cs
- SlipBehavior.cs
- SettingsProviderCollection.cs
- DataControlButton.cs
- FixedSOMLineCollection.cs
- HtmlEmptyTagControlBuilder.cs
- EncoderNLS.cs
- CompiledIdentityConstraint.cs
- TextServicesManager.cs
- XmlLangPropertyAttribute.cs
- RijndaelManagedTransform.cs
- FlatButtonAppearance.cs
- ViewGenerator.cs
- dtdvalidator.cs
- ConfigurationManagerInternal.cs
- SortDescriptionCollection.cs
- BrowsableAttribute.cs
- SqlAggregateChecker.cs
- MimeTypeAttribute.cs
- CapabilitiesUse.cs
- FixedSOMContainer.cs
- RotateTransform3D.cs
- DataSetFieldSchema.cs
- FormsAuthenticationConfiguration.cs
- Rules.cs
- SoapExtensionTypeElement.cs
- DataFormat.cs
- TypeLibConverter.cs
- StylusPlugin.cs
- UpdatePanel.cs
- ApplicationServiceManager.cs
- OrderedDictionary.cs
- PagesChangedEventArgs.cs
- OverflowException.cs
- DoubleLinkList.cs
- DispatchChannelSink.cs
- ExtendedProperty.cs
- Annotation.cs
- EncodingDataItem.cs
- LongTypeConverter.cs
- AsmxEndpointPickerExtension.cs
- EditingCoordinator.cs
- DropShadowEffect.cs
- Point.cs
- __TransparentProxy.cs
- _IPv4Address.cs
- XmlUtf8RawTextWriter.cs
- GetMemberBinder.cs
- PostBackOptions.cs
- ToolboxItemFilterAttribute.cs
- SafeNativeMethodsOther.cs