Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- NumberSubstitution.cs
- XamlSerializationHelper.cs
- InkCanvas.cs
- RuleSettingsCollection.cs
- FontDifferentiator.cs
- XmlSequenceWriter.cs
- HeaderUtility.cs
- XsltLoader.cs
- EntityDataSourceWrapper.cs
- MultipleViewPattern.cs
- ItemDragEvent.cs
- Stack.cs
- Dynamic.cs
- ContractReference.cs
- XslAst.cs
- OAVariantLib.cs
- AuthenticationModulesSection.cs
- TextWriterTraceListener.cs
- WindowsImpersonationContext.cs
- FactoryMaker.cs
- XmlnsDictionary.cs
- NameSpaceEvent.cs
- EmptyImpersonationContext.cs
- MenuRendererClassic.cs
- ExclusiveNamedPipeTransportManager.cs
- BitmapDecoder.cs
- EventNotify.cs
- EnumBuilder.cs
- InfoCardAsymmetricCrypto.cs
- QueryBranchOp.cs
- ClientTarget.cs
- TypeTypeConverter.cs
- HashHelper.cs
- PartitionResolver.cs
- Composition.cs
- LinqDataSourceValidationException.cs
- UIElement.cs
- XmlReaderDelegator.cs
- FamilyTypefaceCollection.cs
- BoundingRectTracker.cs
- PriorityChain.cs
- RequestCacheManager.cs
- basecomparevalidator.cs
- SqlCacheDependencyDatabase.cs
- ListItem.cs
- AlphaSortedEnumConverter.cs
- RectKeyFrameCollection.cs
- IDQuery.cs
- ScriptMethodAttribute.cs
- TextSpan.cs
- PartialCachingAttribute.cs
- IdnMapping.cs
- ListViewGroup.cs
- PageThemeBuildProvider.cs
- BaseTypeViewSchema.cs
- DataConnectionHelper.cs
- ReflectionPermission.cs
- SQLRoleProvider.cs
- ToolStripItemRenderEventArgs.cs
- PDBReader.cs
- ContentIterators.cs
- PositiveTimeSpanValidator.cs
- ContextProperty.cs
- EventProperty.cs
- SafeNativeMethods.cs
- ChangePasswordAutoFormat.cs
- ServerIdentity.cs
- ProfileManager.cs
- CommonGetThemePartSize.cs
- RootNamespaceAttribute.cs
- SafeRightsManagementSessionHandle.cs
- ChannelServices.cs
- Pair.cs
- JournalEntryListConverter.cs
- ResourceBinder.cs
- X509Certificate2.cs
- OptimalBreakSession.cs
- Solver.cs
- SystemIcmpV6Statistics.cs
- ContainerSelectorGlyph.cs
- ComNativeDescriptor.cs
- WebBrowser.cs
- DocumentViewerBase.cs
- HTMLTagNameToTypeMapper.cs
- CalendarButton.cs
- CmsUtils.cs
- TextElementCollectionHelper.cs
- SqlServer2KCompatibilityAnnotation.cs
- NativeBuffer.cs
- ColumnMapVisitor.cs
- DataGridViewRowEventArgs.cs
- ContainsRowNumberChecker.cs
- ReachSerializer.cs
- XmlException.cs
- ExtensionWindowHeader.cs
- SchemaNamespaceManager.cs
- ProtectedConfiguration.cs
- CodeDefaultValueExpression.cs
- RuntimeHelpers.cs
- SocketAddress.cs