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
- SerialReceived.cs
- FrameDimension.cs
- Parser.cs
- TextDecorationLocationValidation.cs
- DependencyPropertyHelper.cs
- SplashScreenNativeMethods.cs
- ConfigXmlComment.cs
- TemplateColumn.cs
- NativeMethods.cs
- ToolBarButton.cs
- OptimalBreakSession.cs
- CultureInfoConverter.cs
- FunctionDescription.cs
- BindingOperations.cs
- XamlClipboardData.cs
- HtmlInputFile.cs
- ExpandSegmentCollection.cs
- EditorAttribute.cs
- EpmCustomContentDeSerializer.cs
- KeyedPriorityQueue.cs
- NativeCompoundFileAPIs.cs
- HybridDictionary.cs
- DrawingAttributeSerializer.cs
- SecurityContextSecurityTokenAuthenticator.cs
- ItemsChangedEventArgs.cs
- WebPart.cs
- DataGridViewElement.cs
- PaginationProgressEventArgs.cs
- HostedAspNetEnvironment.cs
- BooleanFacetDescriptionElement.cs
- KeyboardDevice.cs
- HostedHttpContext.cs
- Page.cs
- StrongTypingException.cs
- SimpleWebHandlerParser.cs
- BidOverLoads.cs
- RoleManagerEventArgs.cs
- XmlProcessingInstruction.cs
- MailDefinition.cs
- NameValuePermission.cs
- M3DUtil.cs
- MouseCaptureWithinProperty.cs
- FilterQuery.cs
- OdbcEnvironment.cs
- FileSystemInfo.cs
- ModuleElement.cs
- SmiEventSink_DeferedProcessing.cs
- XPathNavigatorKeyComparer.cs
- BodyGlyph.cs
- DetailsViewDesigner.cs
- NamespaceCollection.cs
- WindowsButton.cs
- DesignerTransaction.cs
- TabItemWrapperAutomationPeer.cs
- ListChangedEventArgs.cs
- Cursor.cs
- CompositeActivityTypeDescriptorProvider.cs
- NavigationHelper.cs
- BinaryObjectInfo.cs
- TextServicesHost.cs
- SchemaImporter.cs
- GuidTagList.cs
- SourceFilter.cs
- SelectionEditingBehavior.cs
- DataException.cs
- embossbitmapeffect.cs
- XmlSchemaComplexContentRestriction.cs
- ItemMap.cs
- IIS7WorkerRequest.cs
- X509CertificateValidator.cs
- EntityConnection.cs
- LineSegment.cs
- URI.cs
- ComMethodElementCollection.cs
- ExcCanonicalXml.cs
- Function.cs
- ViewStateAttachedPropertyFeature.cs
- CustomTrackingRecord.cs
- TransformDescriptor.cs
- SqlConnectionPoolProviderInfo.cs
- Base64Encoding.cs
- SizeF.cs
- SafeSecurityHelper.cs
- DataRecordInfo.cs
- ListQueryResults.cs
- BufferedWebEventProvider.cs
- GridEntry.cs
- FormViewPagerRow.cs
- GenericEnumerator.cs
- SHA512Managed.cs
- Validator.cs
- WindowsListViewScroll.cs
- EndpointDesigner.cs
- WorkflowPrinting.cs
- BooleanAnimationUsingKeyFrames.cs
- SqlAliasesReferenced.cs
- SqlClientMetaDataCollectionNames.cs
- HtmlContainerControl.cs
- DeclarativeCatalogPart.cs
- SQLInt64.cs