Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- UIEndRequest.cs
- Stopwatch.cs
- Triplet.cs
- ProjectionQueryOptionExpression.cs
- XPathEmptyIterator.cs
- CompModSwitches.cs
- MDIWindowDialog.cs
- shaperfactory.cs
- LinearGradientBrush.cs
- XPathNode.cs
- AutomationIdentifier.cs
- PropertyPanel.cs
- _ChunkParse.cs
- GenericUriParser.cs
- PtsHost.cs
- NativeCompoundFileAPIs.cs
- DrawingDrawingContext.cs
- CustomAttributeBuilder.cs
- FtpWebRequest.cs
- BitmapEffect.cs
- PageRouteHandler.cs
- DataGridTextBoxColumn.cs
- PerformanceCounterPermissionAttribute.cs
- Connector.cs
- LZCodec.cs
- SmiTypedGetterSetter.cs
- StateBag.cs
- AudioException.cs
- GeometryCombineModeValidation.cs
- ObjectHandle.cs
- HttpHandlerAction.cs
- ForwardPositionQuery.cs
- SubpageParaClient.cs
- _FixedSizeReader.cs
- SrgsRulesCollection.cs
- NonVisualControlAttribute.cs
- ChannelManager.cs
- PersonalizationProviderHelper.cs
- _UriTypeConverter.cs
- HtmlInputReset.cs
- AsyncOperationManager.cs
- PropertyValueUIItem.cs
- VariableModifiersHelper.cs
- PeerCollaborationPermission.cs
- TypeSystemHelpers.cs
- DynamicDocumentPaginator.cs
- XComponentModel.cs
- _ScatterGatherBuffers.cs
- TypeForwardedToAttribute.cs
- SqlTriggerAttribute.cs
- CacheForPrimitiveTypes.cs
- EventSinkHelperWriter.cs
- loginstatus.cs
- XmlSchemaInferenceException.cs
- TraceHandlerErrorFormatter.cs
- RefreshEventArgs.cs
- WindowsBrush.cs
- SchemaNotation.cs
- DelegateSerializationHolder.cs
- PathGeometry.cs
- OrderPreservingPipeliningSpoolingTask.cs
- JournalEntryListConverter.cs
- ListViewDeletedEventArgs.cs
- XmlSchemaProviderAttribute.cs
- TimelineCollection.cs
- ObjectDataSourceView.cs
- FlowDocumentScrollViewer.cs
- CommandTreeTypeHelper.cs
- HtmlMeta.cs
- XmlSerializerNamespaces.cs
- XmlProcessingInstruction.cs
- TransactionChannelFactory.cs
- ManualResetEvent.cs
- DbProviderServices.cs
- OleDbSchemaGuid.cs
- DoubleMinMaxAggregationOperator.cs
- EdmProperty.cs
- FunctionGenerator.cs
- SamlAuthenticationClaimResource.cs
- StrongNamePublicKeyBlob.cs
- TextTreeInsertElementUndoUnit.cs
- DocumentViewerAutomationPeer.cs
- GACMembershipCondition.cs
- PropertyTab.cs
- MimeXmlReflector.cs
- Scheduler.cs
- ListViewInsertionMark.cs
- HttpApplicationFactory.cs
- StrongNamePublicKeyBlob.cs
- TextTreeTextBlock.cs
- AsyncPostBackErrorEventArgs.cs
- WebPartDisplayModeCollection.cs
- JsonDataContract.cs
- SymbolType.cs
- TimerElapsedEvenArgs.cs
- XmlnsPrefixAttribute.cs
- MediaContext.cs
- ColorAnimation.cs
- BuildResultCache.cs
- Model3DCollection.cs