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
- KeyFrames.cs
- WebPartsPersonalization.cs
- XmlNodeComparer.cs
- ComplexType.cs
- DeclaredTypeValidator.cs
- HiddenField.cs
- DoubleAnimationBase.cs
- IndexingContentUnit.cs
- HttpListener.cs
- PersonalizationStateInfo.cs
- HttpWebRequestElement.cs
- Roles.cs
- SamlConstants.cs
- AggregateNode.cs
- WebPartUtil.cs
- Activator.cs
- NamespaceMapping.cs
- recordstatescratchpad.cs
- XmlQueryCardinality.cs
- NegotiationTokenAuthenticatorState.cs
- BatchStream.cs
- StateItem.cs
- CodeCompiler.cs
- FileAuthorizationModule.cs
- ObjectParameter.cs
- CancellationHandlerDesigner.cs
- backend.cs
- SymLanguageVendor.cs
- CompositeFontInfo.cs
- DbConnectionHelper.cs
- _LocalDataStore.cs
- ScrollEvent.cs
- CodeDirectiveCollection.cs
- _AutoWebProxyScriptEngine.cs
- SortedSet.cs
- AudioLevelUpdatedEventArgs.cs
- UTF8Encoding.cs
- ActivityPropertyReference.cs
- DbConnectionInternal.cs
- CodeExporter.cs
- AutomationElementCollection.cs
- XmlUTF8TextReader.cs
- BinaryFormatter.cs
- SafeCertificateStore.cs
- DiagnosticsElement.cs
- NetMsmqBinding.cs
- BitmapEffectInput.cs
- ExportOptions.cs
- _ScatterGatherBuffers.cs
- ClientScriptManagerWrapper.cs
- ThemeInfoAttribute.cs
- SQLConvert.cs
- XmlCustomFormatter.cs
- WindowsListViewSubItem.cs
- TypedReference.cs
- XmlHierarchyData.cs
- RoleBoolean.cs
- DataKeyPropertyAttribute.cs
- EntityDataSourceWizardForm.cs
- DataGridPagerStyle.cs
- Label.cs
- PassportAuthentication.cs
- DependencyPropertyKind.cs
- XamlReaderHelper.cs
- CompensationHandlingFilter.cs
- XmlIncludeAttribute.cs
- ToolStripDesignerAvailabilityAttribute.cs
- Version.cs
- HttpCacheVaryByContentEncodings.cs
- SqlGenericUtil.cs
- MailSettingsSection.cs
- StringInfo.cs
- BrushMappingModeValidation.cs
- StatusStrip.cs
- ObjectResult.cs
- RegionInfo.cs
- XsdCachingReader.cs
- ISFClipboardData.cs
- EncodingNLS.cs
- StateMachine.cs
- Dictionary.cs
- EnumType.cs
- StreamWithDictionary.cs
- CodeRemoveEventStatement.cs
- X509CertificateRecipientClientCredential.cs
- WeakReferenceList.cs
- LocalFileSettingsProvider.cs
- Stroke2.cs
- Rfc2898DeriveBytes.cs
- CqlLexerHelpers.cs
- HitTestFilterBehavior.cs
- BaseTemplateCodeDomTreeGenerator.cs
- TCEAdapterGenerator.cs
- ServicePoint.cs
- ComboBox.cs
- TaskForm.cs
- BufferedGraphicsManager.cs
- LinqDataSource.cs
- HyperLink.cs
- baseaxisquery.cs