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
- RowSpanVector.cs
- RequiredFieldValidator.cs
- WmpBitmapDecoder.cs
- SmtpFailedRecipientException.cs
- QueryProcessor.cs
- X509InitiatorCertificateClientElement.cs
- ResourceDictionaryCollection.cs
- CodeTypeParameterCollection.cs
- NetworkStream.cs
- NotCondition.cs
- DateTimeStorage.cs
- IssuedTokenClientBehaviorsElementCollection.cs
- CustomErrorsSection.cs
- WebPartConnectionsCancelVerb.cs
- DateTimeOffsetAdapter.cs
- PathFigure.cs
- AccessViolationException.cs
- ArcSegment.cs
- TypeBuilderInstantiation.cs
- SelectionWordBreaker.cs
- XmlSchemaChoice.cs
- XmlSerializerFormatAttribute.cs
- EUCJPEncoding.cs
- HtmlTextArea.cs
- ErrorRuntimeConfig.cs
- XmlSchemaAnyAttribute.cs
- CaseStatementSlot.cs
- EdmComplexTypeAttribute.cs
- PropertyDescriptor.cs
- XPathSelectionIterator.cs
- DrawItemEvent.cs
- SessionStateUtil.cs
- PathFigureCollection.cs
- ValidationSummary.cs
- TraceInternal.cs
- XmlDataProvider.cs
- HttpResponseHeader.cs
- ColumnWidthChangedEvent.cs
- FieldMetadata.cs
- UnionCodeGroup.cs
- XmlUtilWriter.cs
- securitycriticaldataformultiplegetandset.cs
- Line.cs
- MimeParameters.cs
- CategoryEditor.cs
- returneventsaver.cs
- GeneralTransform2DTo3D.cs
- DesignRelation.cs
- grammarelement.cs
- BrushValueSerializer.cs
- ColumnResult.cs
- Sentence.cs
- _AutoWebProxyScriptEngine.cs
- ColorTranslator.cs
- TypedTableBaseExtensions.cs
- FileUpload.cs
- AssemblyNameProxy.cs
- MarkerProperties.cs
- EventLogPermissionEntryCollection.cs
- DataPager.cs
- Atom10FormatterFactory.cs
- ServiceParser.cs
- MessageQueueException.cs
- RawUIStateInputReport.cs
- FlowLayout.cs
- _AutoWebProxyScriptWrapper.cs
- FontFamily.cs
- ToolboxControl.cs
- GeneratedView.cs
- ResXDataNode.cs
- SettingsBindableAttribute.cs
- SqlLiftIndependentRowExpressions.cs
- DataRowCollection.cs
- FilterableAttribute.cs
- TextTrailingCharacterEllipsis.cs
- CellIdBoolean.cs
- Vector3DConverter.cs
- VectorValueSerializer.cs
- UnaryNode.cs
- AnchorEditor.cs
- SectionInput.cs
- SchemaConstraints.cs
- DateTimeOffset.cs
- BaseValidator.cs
- GiveFeedbackEventArgs.cs
- WaitHandle.cs
- ScalarType.cs
- ControlBindingsConverter.cs
- DescendentsWalker.cs
- MimeBasePart.cs
- BackStopAuthenticationModule.cs
- AssemblyUtil.cs
- RequestTimeoutManager.cs
- TextDecorationUnitValidation.cs
- Viewport3DVisual.cs
- WriteableBitmap.cs
- AsyncPostBackErrorEventArgs.cs
- XmlQueryContext.cs
- WindowsButton.cs
- FastPropertyAccessor.cs