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
- SynchronizedKeyedCollection.cs
- DetailsViewPageEventArgs.cs
- StylusPlugInCollection.cs
- OdbcRowUpdatingEvent.cs
- SqlCacheDependencyDatabase.cs
- safex509handles.cs
- LinqDataSource.cs
- IndexedGlyphRun.cs
- StreamFormatter.cs
- UIPropertyMetadata.cs
- QuaternionValueSerializer.cs
- DataTableClearEvent.cs
- SqlConnectionManager.cs
- ObjectDataSourceFilteringEventArgs.cs
- DataGridSortCommandEventArgs.cs
- isolationinterop.cs
- ExclusiveHandleList.cs
- WindowsProgressbar.cs
- EndGetFileNameFromUserRequest.cs
- LineProperties.cs
- ChainOfResponsibility.cs
- IndependentAnimationStorage.cs
- FunctionMappingTranslator.cs
- CompletionBookmark.cs
- ChangePassword.cs
- AssociationSetMetadata.cs
- AuthenticationService.cs
- BindingEntityInfo.cs
- GcSettings.cs
- DesigntimeLicenseContext.cs
- SerializeAbsoluteContext.cs
- ThreadSafeList.cs
- CacheEntry.cs
- cookieexception.cs
- RemotingServices.cs
- MenuAutomationPeer.cs
- MobilePage.cs
- Exceptions.cs
- JpegBitmapDecoder.cs
- MachineSettingsSection.cs
- FrameworkContentElement.cs
- ReadContentAsBinaryHelper.cs
- HtmlElementErrorEventArgs.cs
- Viewport3DVisual.cs
- XAMLParseException.cs
- SaveLedgerEntryRequest.cs
- HashCryptoHandle.cs
- UrlAuthFailureHandler.cs
- FileRegion.cs
- BatchWriter.cs
- InteropBitmapSource.cs
- DynamicPropertyHolder.cs
- DirectionalLight.cs
- GeneratedCodeAttribute.cs
- IpcChannel.cs
- ImageKeyConverter.cs
- MessagePropertyVariants.cs
- AlternateView.cs
- PopOutPanel.cs
- EtwTrace.cs
- BaseParaClient.cs
- ContractCodeDomInfo.cs
- PropertyManager.cs
- VSWCFServiceContractGenerator.cs
- CompilerErrorCollection.cs
- FieldNameLookup.cs
- XmlLanguageConverter.cs
- RoutedPropertyChangedEventArgs.cs
- CreateParams.cs
- LocalizationComments.cs
- ScriptIgnoreAttribute.cs
- mactripleDES.cs
- DataGridViewAccessibleObject.cs
- Localizer.cs
- StorageMappingItemCollection.cs
- DataFormat.cs
- InputLangChangeRequestEvent.cs
- TemplateBuilder.cs
- LinkDescriptor.cs
- ImpersonateTokenRef.cs
- WebPartManagerInternals.cs
- InteropExecutor.cs
- SchemaType.cs
- PeerNameRecord.cs
- DrawingAttributeSerializer.cs
- WindowsToolbar.cs
- BuildProviderAppliesToAttribute.cs
- PathSegment.cs
- ValueSerializerAttribute.cs
- ObjectManager.cs
- CustomPopupPlacement.cs
- ProfileSettingsCollection.cs
- NetNamedPipeBindingElement.cs
- DataGridViewHeaderCell.cs
- SafeLibraryHandle.cs
- LinqMaximalSubtreeNominator.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- ComplexType.cs
- GeometryModel3D.cs
- OlePropertyStructs.cs