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
- CultureSpecificStringDictionary.cs
- ExpressionWriter.cs
- ImageListUtils.cs
- HtmlHead.cs
- XmlCountingReader.cs
- EditBehavior.cs
- ConfigurationValidatorAttribute.cs
- WebPartDisplayModeEventArgs.cs
- CalendarItem.cs
- TextCharacters.cs
- UTF8Encoding.cs
- CurrentChangedEventManager.cs
- SqlWriter.cs
- FormsAuthenticationConfiguration.cs
- BindToObject.cs
- DictionarySectionHandler.cs
- ArraySegment.cs
- DataControlFieldHeaderCell.cs
- SHA384Managed.cs
- MenuItem.cs
- MultiBindingExpression.cs
- ServiceModelConfigurationSection.cs
- ViewManager.cs
- AssociatedControlConverter.cs
- SqlConnectionString.cs
- Pointer.cs
- SmtpNtlmAuthenticationModule.cs
- ConditionValidator.cs
- HuffModule.cs
- NetworkInformationException.cs
- ImportDesigner.xaml.cs
- GlobalEventManager.cs
- SoapSchemaImporter.cs
- Page.cs
- RoleService.cs
- Int64Storage.cs
- DetailsViewInsertEventArgs.cs
- AttributeEmitter.cs
- SubpageParagraph.cs
- WebPartDisplayModeCancelEventArgs.cs
- Queue.cs
- WebScriptMetadataFormatter.cs
- SQLConvert.cs
- SrgsText.cs
- DocumentApplicationState.cs
- HttpListenerPrefixCollection.cs
- TableLayoutStyleCollection.cs
- XmlObjectSerializerReadContext.cs
- DataSourceSelectArguments.cs
- SettingsPropertyValueCollection.cs
- TextRunCacheImp.cs
- AnnotationAuthorChangedEventArgs.cs
- RangeValueProviderWrapper.cs
- DBSqlParser.cs
- TypeSystem.cs
- QueryableDataSourceView.cs
- TransferRequestHandler.cs
- ElementAtQueryOperator.cs
- SqlDataSourceSummaryPanel.cs
- FloaterParagraph.cs
- ComponentCollection.cs
- PackWebRequestFactory.cs
- EdmType.cs
- UrlPath.cs
- CallTemplateAction.cs
- DataGridViewCellValueEventArgs.cs
- VerticalAlignConverter.cs
- ChangesetResponse.cs
- Rotation3D.cs
- SymbolPair.cs
- ViewRendering.cs
- IndependentAnimationStorage.cs
- LocationUpdates.cs
- ellipse.cs
- SignerInfo.cs
- DataConnectionHelper.cs
- ConfigurationLocation.cs
- Invariant.cs
- ActiveDocumentEvent.cs
- SqlDataSourceCommandEventArgs.cs
- LinkedResourceCollection.cs
- ProviderSettingsCollection.cs
- EditBehavior.cs
- CommonXSendMessage.cs
- MdiWindowListStrip.cs
- PolicyLevel.cs
- GraphicsContainer.cs
- StoreItemCollection.cs
- ScrollData.cs
- TargetConverter.cs
- SAPIEngineTypes.cs
- DesignerSerializerAttribute.cs
- TreeNode.cs
- ComNativeDescriptor.cs
- basevalidator.cs
- WorkflowTraceTransfer.cs
- StringExpressionSet.cs
- BooleanProjectedSlot.cs
- InkCanvasInnerCanvas.cs
- BitmapEffectGroup.cs