Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Automation / Peers / HwndHostAutomationPeer.cs / 1 / 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
- XXXOnTypeBuilderInstantiation.cs
- TabItemWrapperAutomationPeer.cs
- ClientFormsAuthenticationCredentials.cs
- SQLStringStorage.cs
- XmlSchemaInfo.cs
- SoundPlayer.cs
- DATA_BLOB.cs
- DecimalConstantAttribute.cs
- CqlGenerator.cs
- HttpServerUtilityWrapper.cs
- XmlSerializerAssemblyAttribute.cs
- UriExt.cs
- SqlClientWrapperSmiStream.cs
- ParallelSeparator.xaml.cs
- returneventsaver.cs
- DiffuseMaterial.cs
- TransactedBatchingBehavior.cs
- UpdatePanelTrigger.cs
- PolyLineSegment.cs
- XmlSchemaDocumentation.cs
- ExpressionBindingCollection.cs
- UInt64Converter.cs
- DataGridViewTopLeftHeaderCell.cs
- SqlStream.cs
- RijndaelManagedTransform.cs
- EntityViewGenerationAttribute.cs
- ScriptManagerProxy.cs
- BoolExpression.cs
- UriWriter.cs
- KeySplineConverter.cs
- SelectionItemProviderWrapper.cs
- BufferedGraphicsContext.cs
- XpsPackagingException.cs
- BufferBuilder.cs
- ItemType.cs
- ControlParameter.cs
- StringComparer.cs
- AbstractSvcMapFileLoader.cs
- ClosableStream.cs
- Positioning.cs
- AnnotationComponentChooser.cs
- KeyedCollection.cs
- Panel.cs
- GlobalEventManager.cs
- FormatStringEditor.cs
- DataPointer.cs
- ToolStripPanelSelectionGlyph.cs
- WebBrowserBase.cs
- MemberDescriptor.cs
- NegatedConstant.cs
- BindableAttribute.cs
- HelpOperationInvoker.cs
- ProcessMessagesAsyncResult.cs
- InstanceDataCollection.cs
- ConfigLoader.cs
- TrackingStringDictionary.cs
- Pair.cs
- RegexCode.cs
- InlineUIContainer.cs
- CTreeGenerator.cs
- RegisteredExpandoAttribute.cs
- LostFocusEventManager.cs
- ToolTip.cs
- ToolStripPanelCell.cs
- HelpProvider.cs
- RegexInterpreter.cs
- UIElement3D.cs
- FileSystemWatcher.cs
- EncoderFallback.cs
- StickyNote.cs
- LayoutDump.cs
- UriWriter.cs
- CellLabel.cs
- WindowsListViewItem.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- OverflowException.cs
- ExceptionNotification.cs
- Baml2006Reader.cs
- AdornerPresentationContext.cs
- StructuredCompositeActivityDesigner.cs
- FixedDSBuilder.cs
- Mapping.cs
- RepeaterItemEventArgs.cs
- IsolatedStorageFile.cs
- CustomAttributeSerializer.cs
- DataSvcMapFile.cs
- BamlRecordHelper.cs
- GenericEnumerator.cs
- QueryCacheManager.cs
- FreezableDefaultValueFactory.cs
- OperationResponse.cs
- sqlcontext.cs
- FilterEventArgs.cs
- ToolStripDropDownItem.cs
- WebGetAttribute.cs
- MasterPageParser.cs
- SqlNotificationEventArgs.cs
- TextOnlyOutput.cs
- ToolStripPanelRow.cs
- Substitution.cs