Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / HwndHostAutomationPeer.cs / 1305600 / HwndHostAutomationPeer.cs
using System.Collections.Generic; using System.Windows.Automation; using System.Windows.Automation.Provider; using System.Windows.Interop; using System.Security; using System.Security.Permissions; using MS.Internal.Automation; namespace System.Windows.Automation.Peers { /// internal class HwndHostAutomationPeer : FrameworkElementAutomationPeer { /// public HwndHostAutomationPeer(HwndHost owner): base(owner) { IsInteropPeer = true; } /// override protected string GetClassNameCore() { return "HwndHost"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Pane; } ////// Critical - Calls critical HwndHost.CriticalHandle. /// TreatAsSafe - Critical data is used internally and not explosed /// [SecurityCritical, SecurityTreatAsSafe] override internal InteropAutomationProvider GetInteropChild() { if (_interopProvider == null) { HostedWindowWrapper wrapper = null; HwndHost host = (HwndHost)Owner; IntPtr hwnd = host.CriticalHandle; if(hwnd != IntPtr.Zero) { wrapper = HostedWindowWrapper.CreateInternal(hwnd); } _interopProvider = new InteropAutomationProvider(wrapper, this); } return _interopProvider; } #region Data private InteropAutomationProvider _interopProvider; #endregion Data } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System.Collections.Generic; using System.Windows.Automation; using System.Windows.Automation.Provider; using System.Windows.Interop; using System.Security; using System.Security.Permissions; using MS.Internal.Automation; namespace System.Windows.Automation.Peers { /// internal class HwndHostAutomationPeer : FrameworkElementAutomationPeer { /// public HwndHostAutomationPeer(HwndHost owner): base(owner) { IsInteropPeer = true; } /// override protected string GetClassNameCore() { return "HwndHost"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Pane; } ////// Critical - Calls critical HwndHost.CriticalHandle. /// TreatAsSafe - Critical data is used internally and not explosed /// [SecurityCritical, SecurityTreatAsSafe] override internal InteropAutomationProvider GetInteropChild() { if (_interopProvider == null) { HostedWindowWrapper wrapper = null; HwndHost host = (HwndHost)Owner; IntPtr hwnd = host.CriticalHandle; if(hwnd != IntPtr.Zero) { wrapper = HostedWindowWrapper.CreateInternal(hwnd); } _interopProvider = new InteropAutomationProvider(wrapper, this); } return _interopProvider; } #region Data private InteropAutomationProvider _interopProvider; #endregion Data } } // 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
- ToolStripHighContrastRenderer.cs
- PersonalizationStateInfo.cs
- RelationshipEnd.cs
- DesignerTextViewAdapter.cs
- EmptyEnumerable.cs
- ProcessModule.cs
- CodeMemberEvent.cs
- ApplicationInterop.cs
- StringReader.cs
- XhtmlBasicTextViewAdapter.cs
- Stylesheet.cs
- ComEventsSink.cs
- ObjectStateEntryDbDataRecord.cs
- KeyNotFoundException.cs
- NullableDoubleAverageAggregationOperator.cs
- FunctionNode.cs
- QueryableDataSourceView.cs
- SslStreamSecurityUpgradeProvider.cs
- EntityDataSourceWrapper.cs
- clipboard.cs
- sqlser.cs
- SafeLocalMemHandle.cs
- XPathPatternParser.cs
- DataSourceHelper.cs
- ContentPosition.cs
- MethodCallTranslator.cs
- HostedBindingBehavior.cs
- DockPatternIdentifiers.cs
- CommandPlan.cs
- TypeNameParser.cs
- SqlUnionizer.cs
- DataGridSortCommandEventArgs.cs
- WaitHandle.cs
- BasePropertyDescriptor.cs
- Clause.cs
- EventLogPermissionEntryCollection.cs
- SmtpDigestAuthenticationModule.cs
- MissingMethodException.cs
- Stackframe.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- BitmapDownload.cs
- ProxyHwnd.cs
- TemplateBuilder.cs
- EditorZoneDesigner.cs
- TypeBuilder.cs
- BitmapFrameDecode.cs
- ExtenderControl.cs
- HandlerBase.cs
- FileDialogCustomPlacesCollection.cs
- WebServiceResponseDesigner.cs
- ListChangedEventArgs.cs
- AsymmetricAlgorithm.cs
- HttpListenerResponse.cs
- BCryptSafeHandles.cs
- ScriptManager.cs
- DocumentApplicationJournalEntry.cs
- XMLDiffLoader.cs
- DesignerTransactionCloseEvent.cs
- AssemblyAttributes.cs
- WorkflowRequestContext.cs
- ObservableCollection.cs
- CapabilitiesUse.cs
- RtfFormatStack.cs
- OperandQuery.cs
- EmbeddedMailObject.cs
- ExpressionEditorAttribute.cs
- GeneralTransform.cs
- SafeCertificateStore.cs
- BinaryReader.cs
- BaseDataListDesigner.cs
- uribuilder.cs
- Composition.cs
- InvokeBinder.cs
- MLangCodePageEncoding.cs
- DataBoundLiteralControl.cs
- EncryptedHeader.cs
- ConstNode.cs
- QilVisitor.cs
- X509Certificate2Collection.cs
- DesignTimeTemplateParser.cs
- QilChoice.cs
- _ListenerRequestStream.cs
- TemplateControl.cs
- SevenBitStream.cs
- UIElementParagraph.cs
- ApplicationSettingsBase.cs
- CompositeDispatchFormatter.cs
- Base64Decoder.cs
- AvTraceDetails.cs
- MailHeaderInfo.cs
- Sequence.cs
- PropertyFilterAttribute.cs
- Geometry3D.cs
- BrowserInteropHelper.cs
- DesignRelation.cs
- CookieParameter.cs
- MSAANativeProvider.cs
- TextRangeBase.cs
- ErrorProvider.cs
- ComplexBindingPropertiesAttribute.cs