Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- SmiMetaDataProperty.cs
- EventLogPermissionAttribute.cs
- CapabilitiesRule.cs
- ArraySet.cs
- SudsCommon.cs
- ChtmlCommandAdapter.cs
- ILGenerator.cs
- StretchValidation.cs
- TableHeaderCell.cs
- SpotLight.cs
- Variable.cs
- CompiledQuery.cs
- CapabilitiesUse.cs
- MutexSecurity.cs
- figurelengthconverter.cs
- PolicyManager.cs
- CompressedStack.cs
- DataRelation.cs
- Util.cs
- OraclePermissionAttribute.cs
- Decimal.cs
- DisplayInformation.cs
- StorageSetMapping.cs
- AdornerLayer.cs
- CategoryGridEntry.cs
- RelationshipConverter.cs
- SplineKeyFrames.cs
- processwaithandle.cs
- PropertyCollection.cs
- EmptyStringExpandableObjectConverter.cs
- TypedTableBaseExtensions.cs
- PackageDigitalSignature.cs
- SplayTreeNode.cs
- Selection.cs
- GenericIdentity.cs
- DbMetaDataFactory.cs
- Base64Encoding.cs
- XmlSchemas.cs
- PointCollectionValueSerializer.cs
- _UncName.cs
- RegexMatch.cs
- FormatSettings.cs
- ToolStripSplitStackLayout.cs
- ObjectDesignerDataSourceView.cs
- DocumentViewerBaseAutomationPeer.cs
- ObjectCloneHelper.cs
- BitmapCache.cs
- ArraySegment.cs
- FixedSOMLineRanges.cs
- ResourceReferenceExpressionConverter.cs
- IImplicitResourceProvider.cs
- ListCardsInFileRequest.cs
- ThousandthOfEmRealPoints.cs
- ArraySegment.cs
- ConfigurationLockCollection.cs
- SimpleTextLine.cs
- ExpressionBindingCollection.cs
- SmiConnection.cs
- PreviewKeyDownEventArgs.cs
- MobileControlPersister.cs
- ActiveXHost.cs
- MarkupCompilePass1.cs
- ProcessProtocolHandler.cs
- X509Utils.cs
- InfocardInteractiveChannelInitializer.cs
- FileLoadException.cs
- ExtensionFile.cs
- Span.cs
- NameValueSectionHandler.cs
- SetStoryboardSpeedRatio.cs
- NetStream.cs
- DateTimeUtil.cs
- Matrix3DConverter.cs
- ScriptControlManager.cs
- MDIWindowDialog.cs
- ResourceDictionary.cs
- SpeakCompletedEventArgs.cs
- FormatterConverter.cs
- NameValueConfigurationElement.cs
- LongValidator.cs
- ToolStripEditorManager.cs
- GridViewDeletedEventArgs.cs
- FrameworkContentElementAutomationPeer.cs
- SizeKeyFrameCollection.cs
- DecimalAnimationBase.cs
- Propagator.Evaluator.cs
- MenuItem.cs
- MulticastNotSupportedException.cs
- FacetValueContainer.cs
- FontFamilyConverter.cs
- FileLoadException.cs
- UntypedNullExpression.cs
- AxisAngleRotation3D.cs
- UnauthorizedAccessException.cs
- DataSourceView.cs
- MultipleViewProviderWrapper.cs
- XsltContext.cs
- DesignerListAdapter.cs
- MulticastNotSupportedException.cs
- ObjectQueryProvider.cs