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
- ModelPropertyCollectionImpl.cs
- XsltConvert.cs
- DataGridViewColumnConverter.cs
- xmlglyphRunInfo.cs
- _Events.cs
- TableItemStyle.cs
- XamlValidatingReader.cs
- InvokePatternIdentifiers.cs
- VectorCollection.cs
- RijndaelManagedTransform.cs
- StyleSheetRefUrlEditor.cs
- RouteUrlExpressionBuilder.cs
- RuleConditionDialog.Designer.cs
- MergablePropertyAttribute.cs
- WebBrowserNavigatedEventHandler.cs
- Token.cs
- _SslState.cs
- XhtmlBasicFormAdapter.cs
- SignerInfo.cs
- Gdiplus.cs
- ClientRolePrincipal.cs
- GridViewAutomationPeer.cs
- GeometryConverter.cs
- ViewStateModeByIdAttribute.cs
- MenuCommand.cs
- PtsPage.cs
- GetPageCompletedEventArgs.cs
- DbConnectionOptions.cs
- SpecularMaterial.cs
- ZipIOModeEnforcingStream.cs
- UrlPropertyAttribute.cs
- ContractListAdapter.cs
- DataBoundControl.cs
- AuthorizationContext.cs
- JoinTreeSlot.cs
- CompilerParameters.cs
- OrderByQueryOptionExpression.cs
- DoubleLinkListEnumerator.cs
- StyleHelper.cs
- ThreadSafeList.cs
- IsolationInterop.cs
- ErrorFormatterPage.cs
- ConversionContext.cs
- AssemblyHash.cs
- ActivityTypeDesigner.xaml.cs
- IWorkflowDebuggerService.cs
- Closure.cs
- UnSafeCharBuffer.cs
- LineServicesRun.cs
- ScrollEvent.cs
- SecurityTokenValidationException.cs
- ReadOnlyDataSourceView.cs
- RuntimeConfigurationRecord.cs
- Double.cs
- MouseActionValueSerializer.cs
- Hyperlink.cs
- ExtenderControl.cs
- XmlAutoDetectWriter.cs
- LabelDesigner.cs
- HandlerBase.cs
- util.cs
- CellIdBoolean.cs
- ExpandoClass.cs
- DbReferenceCollection.cs
- Message.cs
- SamlEvidence.cs
- TableLayoutPanel.cs
- ServiceBuildProvider.cs
- WebPartDisplayModeCollection.cs
- Vector3DAnimationBase.cs
- SoapHeader.cs
- TemplateField.cs
- XPathDescendantIterator.cs
- GenericIdentity.cs
- Brushes.cs
- KnownBoxes.cs
- EraserBehavior.cs
- XmlCodeExporter.cs
- ParserExtension.cs
- SslStream.cs
- DictionaryContent.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- CellIdBoolean.cs
- ColorAnimationBase.cs
- GeneratedContractType.cs
- TraceSection.cs
- ListViewItem.cs
- PageAdapter.cs
- PackWebResponse.cs
- DataMisalignedException.cs
- SessionParameter.cs
- PathSegmentCollection.cs
- _ConnectionGroup.cs
- MobileTemplatedControlDesigner.cs
- DbSource.cs
- MyContact.cs
- ListBindableAttribute.cs
- FlowDocumentScrollViewer.cs
- NullRuntimeConfig.cs
- Knowncolors.cs