Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / MS / Internal / Data / CollectionViewProxy.cs / 1 / CollectionViewProxy.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// See spec at [....]/connecteddata/Specs/CollectionView.mht
//
// Description: Proxy that adds context affinity to an ICollectionView that
// doesn't already have it.
//
//---------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Threading;
using System.Windows.Data;
namespace MS.Internal.Data
{
///
/// Proxy view, used to interpose between the UI and a view that doesn't
/// support context affinity.
///
internal class CollectionViewProxy : CollectionView
{
//-----------------------------------------------------
//
// Constructors
//
//-----------------------------------------------------
internal CollectionViewProxy(ICollectionView view)
: base(view.SourceCollection, false)
{
_view = view;
view.CollectionChanged += new NotifyCollectionChangedEventHandler(_OnViewChanged);
view.CurrentChanging += new CurrentChangingEventHandler(_OnCurrentChanging);
view.CurrentChanged += new EventHandler(_OnCurrentChanged);
INotifyPropertyChanged ipc = view as INotifyPropertyChanged;
if (ipc != null)
ipc.PropertyChanged += new PropertyChangedEventHandler(_OnPropertyChanged);
}
//------------------------------------------------------
//
// Interfaces
//
//-----------------------------------------------------
#region ICollectionView
///
/// Culture to use during sorting.
///
public override System.Globalization.CultureInfo Culture
{
get { return ProxiedView.Culture; }
set { ProxiedView.Culture = value; }
}
///
/// Return true if the item belongs to this view. No assumptions are
/// made about the item. This method will behave similarly to IList.Contains().
/// If the caller knows that the item belongs to the
/// underlying collection, it is more efficient to call PassesFilter.
///
public override bool Contains(object item)
{
return ProxiedView.Contains(item);
}
///
/// SourceCollection is the original un-filtered collection of which
/// this ICollectionView is a view.
///
public override IEnumerable SourceCollection
{
get { return base.SourceCollection; }
}
///
/// Set/get a filter callback to filter out items in collection.
/// This property will always accept a filter, but the collection view for the
/// underlying InnerList or ItemsSource may not actually support filtering.
/// Please check
///
///
/// Collections assigned to ItemsSource may not support filtering and could throw a NotSupportedException.
/// Use property to test if sorting is supported before adding
/// to SortDescriptions.
///
public override Predicate
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PrintDialog.cs
- InputLanguage.cs
- ErrorTableItemStyle.cs
- ParagraphVisual.cs
- String.cs
- Graph.cs
- ellipse.cs
- RequestCacheManager.cs
- BackgroundFormatInfo.cs
- Error.cs
- WebPartCloseVerb.cs
- OpacityConverter.cs
- OdbcTransaction.cs
- ReversePositionQuery.cs
- CellTreeNode.cs
- DrawingContextWalker.cs
- GPPOINT.cs
- ObjectViewFactory.cs
- PropertyCollection.cs
- XmlMtomWriter.cs
- OrderByLifter.cs
- WebScriptMetadataMessageEncoderFactory.cs
- DataGridSortCommandEventArgs.cs
- TextRunCacheImp.cs
- loginstatus.cs
- Stopwatch.cs
- WindowsToolbarAsMenu.cs
- UriTemplatePathPartiallyEquivalentSet.cs
- WindowsAuthenticationEventArgs.cs
- DataGridViewCellValidatingEventArgs.cs
- BinaryConverter.cs
- TypeElement.cs
- wmiprovider.cs
- XmlChildNodes.cs
- MimeAnyImporter.cs
- WrappedIUnknown.cs
- RunWorkerCompletedEventArgs.cs
- FileReservationCollection.cs
- PageVisual.cs
- XmlAttributeCache.cs
- SelectionChangedEventArgs.cs
- XmlChildEnumerator.cs
- MultilineStringConverter.cs
- TextElementCollectionHelper.cs
- HttpFileCollectionBase.cs
- FileLoadException.cs
- WebPartEditorApplyVerb.cs
- WCFServiceClientProxyGenerator.cs
- AxisAngleRotation3D.cs
- CompilerErrorCollection.cs
- SoapTransportImporter.cs
- NumberFunctions.cs
- ConnectionConsumerAttribute.cs
- SecurityTokenTypes.cs
- Literal.cs
- MenuScrollingVisibilityConverter.cs
- Comparer.cs
- Int64AnimationBase.cs
- Debugger.cs
- ToolStripGripRenderEventArgs.cs
- RemotingService.cs
- WpfGeneratedKnownProperties.cs
- StyleXamlParser.cs
- Grammar.cs
- PackageDigitalSignatureManager.cs
- TextMetrics.cs
- PageRequestManager.cs
- DBCommand.cs
- UnsafeNativeMethodsCLR.cs
- XmlLinkedNode.cs
- HelpEvent.cs
- DoubleCollectionConverter.cs
- ImpersonateTokenRef.cs
- XmlSubtreeReader.cs
- AttributeEmitter.cs
- CompressionTracing.cs
- DesignerHelpers.cs
- StandardCommands.cs
- LinqDataSourceView.cs
- EnumerableRowCollectionExtensions.cs
- SqlProviderManifest.cs
- WebPartExportVerb.cs
- ReferentialConstraintRoleElement.cs
- SelectionListComponentEditor.cs
- HWStack.cs
- SqlCommandSet.cs
- CodeDefaultValueExpression.cs
- ConnectionManagementElementCollection.cs
- DbParameterCollection.cs
- Parameter.cs
- EntityParameter.cs
- JsonGlobals.cs
- ButtonColumn.cs
- DataRowComparer.cs
- XNodeNavigator.cs
- GridViewSelectEventArgs.cs
- SimpleTypesSurrogate.cs
- HostTimeoutsElement.cs
- WebPartsPersonalizationAuthorization.cs
- ControlPaint.cs