Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Automation / Peers / ListViewAutomationPeer.cs / 1 / 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
- ReadingWritingEntityEventArgs.cs
- GeneralTransform2DTo3D.cs
- Point3DCollection.cs
- QuadraticBezierSegment.cs
- UnsafeNativeMethods.cs
- RoutedEventHandlerInfo.cs
- TransactionOptions.cs
- SqlDeflator.cs
- AsymmetricKeyExchangeDeformatter.cs
- BitVector32.cs
- MethodBuilder.cs
- QilReplaceVisitor.cs
- NamespaceInfo.cs
- TextEffectCollection.cs
- InternalControlCollection.cs
- Switch.cs
- ScrollChangedEventArgs.cs
- DefaultSection.cs
- XmlSchemaAny.cs
- MenuItemStyleCollection.cs
- TemplateBaseAction.cs
- DiffuseMaterial.cs
- GeneralTransform3DTo2DTo3D.cs
- ViewSimplifier.cs
- Queue.cs
- ServiceProviders.cs
- WindowShowOrOpenTracker.cs
- RSAOAEPKeyExchangeDeformatter.cs
- DesignerMetadata.cs
- ItemContainerPattern.cs
- COM2Enum.cs
- XmlKeywords.cs
- MouseOverProperty.cs
- ElementHost.cs
- ServiceModelConfigurationElementCollection.cs
- CodeAttributeArgument.cs
- URLAttribute.cs
- OpenFileDialog.cs
- Comparer.cs
- ServiceOperationUIEditor.cs
- JapaneseCalendar.cs
- NativeWindow.cs
- SafeMILHandle.cs
- AssemblyNameProxy.cs
- RTTrackingProfile.cs
- ToolStripDropDownDesigner.cs
- XmlSchemaInferenceException.cs
- RowToFieldTransformer.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- InputBindingCollection.cs
- HttpModuleActionCollection.cs
- DocumentXPathNavigator.cs
- ReceiveSecurityHeaderEntry.cs
- LogicalExpr.cs
- BrowserCapabilitiesFactoryBase.cs
- InfiniteIntConverter.cs
- DefaultValueTypeConverter.cs
- CodeValidator.cs
- AlphaSortedEnumConverter.cs
- TraceHandlerErrorFormatter.cs
- ServerValidateEventArgs.cs
- GcSettings.cs
- LocalFileSettingsProvider.cs
- ChannelListenerBase.cs
- GenericWebPart.cs
- Int32CollectionConverter.cs
- DataGridItemEventArgs.cs
- CodeDefaultValueExpression.cs
- ReadOnlyDataSource.cs
- ItemsControl.cs
- XsltContext.cs
- VSWCFServiceContractGenerator.cs
- MissingFieldException.cs
- PrinterUnitConvert.cs
- localization.cs
- ValidationRuleCollection.cs
- UnsafePeerToPeerMethods.cs
- SQLInt32.cs
- WorkflowViewService.cs
- StoragePropertyMapping.cs
- DateTimeAutomationPeer.cs
- SoapServerMethod.cs
- XsltInput.cs
- CodeExporter.cs
- StructuralComparisons.cs
- IDReferencePropertyAttribute.cs
- AsymmetricAlgorithm.cs
- StdRegProviderWrapper.cs
- DataSourceDesigner.cs
- XmlSchemaDocumentation.cs
- Stream.cs
- ValueChangedEventManager.cs
- RenderDataDrawingContext.cs
- PrintDocument.cs
- UserPersonalizationStateInfo.cs
- SiteMapDataSourceDesigner.cs
- SrgsItemList.cs
- ErasingStroke.cs
- ProfileSettings.cs
- MarshalByValueComponent.cs