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
- Span.cs
- WorkingDirectoryEditor.cs
- ButtonBase.cs
- BaseDataListActionList.cs
- NamespaceCollection.cs
- TransformedBitmap.cs
- WebScriptMetadataMessage.cs
- WebHeaderCollection.cs
- RowUpdatedEventArgs.cs
- HttpContextWrapper.cs
- HitTestParameters3D.cs
- StsCommunicationException.cs
- EntityConnectionStringBuilderItem.cs
- ShaperBuffers.cs
- DataServiceStreamResponse.cs
- TaskExceptionHolder.cs
- DataServiceHost.cs
- UnSafeCharBuffer.cs
- WebPartAddingEventArgs.cs
- PhotoPrintingIntent.cs
- InternalBase.cs
- ReceiveErrorHandling.cs
- OciHandle.cs
- Pair.cs
- FormsAuthenticationUserCollection.cs
- ObjectQueryExecutionPlan.cs
- MachineKeyConverter.cs
- EncryptedXml.cs
- Double.cs
- precedingquery.cs
- DbTransaction.cs
- Image.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- KnownTypesHelper.cs
- ResourceAssociationSet.cs
- Buffer.cs
- HostingPreferredMapPath.cs
- SkinBuilder.cs
- LogExtent.cs
- ToolStripDropDownDesigner.cs
- UserControlFileEditor.cs
- XmlDeclaration.cs
- HelloMessage11.cs
- FramingDecoders.cs
- MimeObjectFactory.cs
- WsiProfilesElement.cs
- VectorCollectionValueSerializer.cs
- ColorBlend.cs
- RelationalExpressions.cs
- SharedStatics.cs
- SqlXmlStorage.cs
- TemplateXamlTreeBuilder.cs
- AttachedAnnotationChangedEventArgs.cs
- ParallelLoopState.cs
- UrlAuthorizationModule.cs
- EFColumnProvider.cs
- CodeArgumentReferenceExpression.cs
- XmlTextEncoder.cs
- OracleMonthSpan.cs
- ParamArrayAttribute.cs
- CalendarDay.cs
- SchemaLookupTable.cs
- ObfuscateAssemblyAttribute.cs
- ObjectIDGenerator.cs
- ExpressionPrefixAttribute.cs
- AccessDataSource.cs
- LeaseManager.cs
- DescendantQuery.cs
- pingexception.cs
- CoreSwitches.cs
- DataServiceEntityAttribute.cs
- TextTreeDeleteContentUndoUnit.cs
- MasterPageCodeDomTreeGenerator.cs
- ObjectToModelValueConverter.cs
- HttpRequestCacheValidator.cs
- Native.cs
- DelayedRegex.cs
- CodeLinePragma.cs
- OleDbWrapper.cs
- HwndSourceParameters.cs
- OleDbError.cs
- __Filters.cs
- RectangleHotSpot.cs
- TextParagraphCache.cs
- SqlConnection.cs
- TableDetailsRow.cs
- StringDictionaryWithComparer.cs
- MaxValueConverter.cs
- FileStream.cs
- GatewayIPAddressInformationCollection.cs
- DateTimeFormat.cs
- PtsContext.cs
- FontUnitConverter.cs
- DirectionalLight.cs
- XmlObjectSerializerReadContextComplex.cs
- EntityEntry.cs
- DesignerCategoryAttribute.cs
- XamlClipboardData.cs
- OrderedDictionary.cs
- EventLogTraceListener.cs