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
- DesignerView.Commands.cs
- DataSourceExpressionCollection.cs
- AsmxEndpointPickerExtension.cs
- LineProperties.cs
- WaitHandle.cs
- GridViewColumnHeaderAutomationPeer.cs
- XmlElementAttributes.cs
- QuaternionAnimationUsingKeyFrames.cs
- EmptyControlCollection.cs
- TransformedBitmap.cs
- TableParagraph.cs
- XmlSchemaIdentityConstraint.cs
- BuilderPropertyEntry.cs
- InstanceDescriptor.cs
- UnsafeNativeMethods.cs
- CompiledAction.cs
- ClickablePoint.cs
- InstanceData.cs
- Range.cs
- TdsValueSetter.cs
- OleDbParameterCollection.cs
- NamespaceTable.cs
- MachineKeyConverter.cs
- PeerContact.cs
- SqlDataSourceConfigureSelectPanel.cs
- URL.cs
- ReadOnlyKeyedCollection.cs
- ReflectionServiceProvider.cs
- WpfKnownTypeInvoker.cs
- EventHandlersStore.cs
- XmlBinaryReader.cs
- PathSegment.cs
- DependencyPropertyConverter.cs
- WebPartTransformerAttribute.cs
- WebBrowserNavigatedEventHandler.cs
- MarkupCompilePass2.cs
- PackWebRequest.cs
- ConnectionsZone.cs
- SafePEFileHandle.cs
- sqlcontext.cs
- SetStoryboardSpeedRatio.cs
- NamespaceEmitter.cs
- ImageClickEventArgs.cs
- Throw.cs
- LogEntryHeaderv1Deserializer.cs
- XmlDataDocument.cs
- CoreSwitches.cs
- MediaScriptCommandRoutedEventArgs.cs
- SignatureDescription.cs
- AnnotationObservableCollection.cs
- GridEntryCollection.cs
- TemplateNameScope.cs
- TraceLevelStore.cs
- ListControl.cs
- DefaultEvaluationContext.cs
- WebPartPersonalization.cs
- ResourcesChangeInfo.cs
- BitmapScalingModeValidation.cs
- UniqueIdentifierService.cs
- FontInfo.cs
- HttpRequestBase.cs
- PhysicalFontFamily.cs
- PersonalizationDictionary.cs
- XmlDataSourceView.cs
- DataSourceControlBuilder.cs
- TokenCreationException.cs
- SafeFileMappingHandle.cs
- BufferBuilder.cs
- GorillaCodec.cs
- XPathItem.cs
- PassportIdentity.cs
- FixedTextSelectionProcessor.cs
- XmlWhitespace.cs
- PageBuildProvider.cs
- ConfigurationHandlersInstallComponent.cs
- AttributeSetAction.cs
- HandleExceptionArgs.cs
- CustomValidator.cs
- SubstitutionList.cs
- GradientSpreadMethodValidation.cs
- SizeKeyFrameCollection.cs
- ToolBarOverflowPanel.cs
- PrinterSettings.cs
- RawStylusActions.cs
- StaticExtension.cs
- GregorianCalendar.cs
- RefreshEventArgs.cs
- ProtectedConfiguration.cs
- DataGridSortCommandEventArgs.cs
- XmlDocument.cs
- ListItemParagraph.cs
- ColumnPropertiesGroup.cs
- BaseTemplateParser.cs
- RemotingConfiguration.cs
- ConstructorNeedsTagAttribute.cs
- TdsParserStateObject.cs
- RoutedEventArgs.cs
- TraceSection.cs
- ExceptionWrapper.cs
- DataProtectionSecurityStateEncoder.cs