Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / ListViewAutomationPeer.cs / 1305600 / ListViewAutomationPeer.cs
using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Interop; using System.Windows.Media; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class ListViewAutomationPeer : ListBoxAutomationPeer { /// public ListViewAutomationPeer(ListView owner) : base(owner) { Invariant.Assert(owner != null); } /// override protected AutomationControlType GetAutomationControlTypeCore() { if (_viewAutomationPeer != null) { return _viewAutomationPeer.GetAutomationControlType(); } else { return base.GetAutomationControlTypeCore(); } } /// override protected string GetClassNameCore() { return "ListView"; } /// override public object GetPattern(PatternInterface patternInterface) { object ret = null; if (_viewAutomationPeer != null) { ret = _viewAutomationPeer.GetPattern(patternInterface); if (ret != null) { return ret; } } return base.GetPattern(patternInterface); } /// protected override ListGetChildrenCore() { if (_refreshItemPeers) { _refreshItemPeers = false; ItemPeers.Clear(); } List ret = base.GetChildrenCore(); if (_viewAutomationPeer != null) { //If a custom view doesn't want to implement GetChildren details //just return null, we'll use the base.GetChildren as the return value ret = _viewAutomationPeer.GetChildren(ret); } return ret; } /// protected override ItemAutomationPeer CreateItemAutomationPeer(object item) { return _viewAutomationPeer == null ? base.CreateItemAutomationPeer(item) : _viewAutomationPeer.CreateItemAutomationPeer(item); } /// /// /// protected internal IViewAutomationPeer ViewAutomationPeer { // Note: see bug 1555137 for details. // Never inline, as we don't want to unnecessarily link the // automation DLL via the ISelectionProvider interface type initialization. [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get { return _viewAutomationPeer; } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] set { if (_viewAutomationPeer != value) { _refreshItemPeers = true; } _viewAutomationPeer = value; } } #region Private Fields private bool _refreshItemPeers = false; private IViewAutomationPeer _viewAutomationPeer; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Interop; using System.Windows.Media; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class ListViewAutomationPeer : ListBoxAutomationPeer { /// public ListViewAutomationPeer(ListView owner) : base(owner) { Invariant.Assert(owner != null); } /// override protected AutomationControlType GetAutomationControlTypeCore() { if (_viewAutomationPeer != null) { return _viewAutomationPeer.GetAutomationControlType(); } else { return base.GetAutomationControlTypeCore(); } } /// override protected string GetClassNameCore() { return "ListView"; } /// override public object GetPattern(PatternInterface patternInterface) { object ret = null; if (_viewAutomationPeer != null) { ret = _viewAutomationPeer.GetPattern(patternInterface); if (ret != null) { return ret; } } return base.GetPattern(patternInterface); } /// protected override ListGetChildrenCore() { if (_refreshItemPeers) { _refreshItemPeers = false; ItemPeers.Clear(); } List ret = base.GetChildrenCore(); if (_viewAutomationPeer != null) { //If a custom view doesn't want to implement GetChildren details //just return null, we'll use the base.GetChildren as the return value ret = _viewAutomationPeer.GetChildren(ret); } return ret; } /// protected override ItemAutomationPeer CreateItemAutomationPeer(object item) { return _viewAutomationPeer == null ? base.CreateItemAutomationPeer(item) : _viewAutomationPeer.CreateItemAutomationPeer(item); } /// /// /// protected internal IViewAutomationPeer ViewAutomationPeer { // Note: see bug 1555137 for details. // Never inline, as we don't want to unnecessarily link the // automation DLL via the ISelectionProvider interface type initialization. [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get { return _viewAutomationPeer; } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] set { if (_viewAutomationPeer != value) { _refreshItemPeers = true; } _viewAutomationPeer = value; } } #region Private Fields private bool _refreshItemPeers = false; private IViewAutomationPeer _viewAutomationPeer; #endregion } } // 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
- TextEditorContextMenu.cs
- MetadataAssemblyHelper.cs
- XmlCodeExporter.cs
- httpapplicationstate.cs
- ReliableOutputConnection.cs
- RoutedEventConverter.cs
- VisualStyleInformation.cs
- TypeValidationEventArgs.cs
- Contracts.cs
- PathGeometry.cs
- ColorConvertedBitmap.cs
- DragCompletedEventArgs.cs
- JsonMessageEncoderFactory.cs
- CatalogPartCollection.cs
- TextSearch.cs
- DecimalConverter.cs
- ByteStreamMessageEncodingElement.cs
- OracleRowUpdatedEventArgs.cs
- NetStream.cs
- SettingsBase.cs
- PrimitiveCodeDomSerializer.cs
- Operators.cs
- CodeGotoStatement.cs
- AsymmetricKeyExchangeDeformatter.cs
- RenderDataDrawingContext.cs
- DefaultBinder.cs
- DeclarativeCatalogPartDesigner.cs
- IImplicitResourceProvider.cs
- SourceChangedEventArgs.cs
- WinEventWrap.cs
- Base64Stream.cs
- LoginName.cs
- DataGridViewColumnEventArgs.cs
- NonBatchDirectoryCompiler.cs
- MethodBuilder.cs
- DataGridViewColumnStateChangedEventArgs.cs
- TCEAdapterGenerator.cs
- MemberRelationshipService.cs
- mediapermission.cs
- PasswordRecovery.cs
- Pkcs9Attribute.cs
- NetworkStream.cs
- Int64Animation.cs
- ServiceInfo.cs
- JulianCalendar.cs
- UiaCoreTypesApi.cs
- TextPointerBase.cs
- PostBackTrigger.cs
- TextFormatter.cs
- FilterException.cs
- SqlServices.cs
- Helpers.cs
- PrimitiveXmlSerializers.cs
- Point.cs
- DummyDataSource.cs
- XmlSerializableServices.cs
- EntityCommandCompilationException.cs
- sqlinternaltransaction.cs
- RegexInterpreter.cs
- Update.cs
- RouteParametersHelper.cs
- ToolStripContentPanelRenderEventArgs.cs
- ToolboxItemCollection.cs
- XmlElement.cs
- ParameterCollection.cs
- ProviderConnectionPoint.cs
- WaitHandle.cs
- PropertyChange.cs
- BinaryFormatter.cs
- ReflectionPermission.cs
- SQLDateTimeStorage.cs
- DescendantOverDescendantQuery.cs
- DataChangedEventManager.cs
- StreamResourceInfo.cs
- PathFigure.cs
- PassportAuthenticationModule.cs
- AttributeAction.cs
- FileLoadException.cs
- FlowDocument.cs
- PolicyStatement.cs
- SessionStateContainer.cs
- ResourceDescriptionAttribute.cs
- TagPrefixCollection.cs
- NameValuePair.cs
- AuthenticationServiceManager.cs
- StorageComplexPropertyMapping.cs
- UnionExpr.cs
- ListBoxChrome.cs
- MulticastNotSupportedException.cs
- ControlBuilderAttribute.cs
- ResourceReferenceExpression.cs
- FloatMinMaxAggregationOperator.cs
- PolyLineSegment.cs
- DynamicAttribute.cs
- ComPlusInstanceProvider.cs
- dataSvcMapFileLoader.cs
- SplineKeyFrames.cs
- TextEditorContextMenu.cs
- CollectionChangedEventManager.cs
- ThreadSafeList.cs