Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / MS / Internal / Data / CollectionViewGroupRoot.cs / 1 / CollectionViewGroupRoot.cs
//---------------------------------------------------------------------------- // //// Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // // // // Description: Root of CollectionViewGroup structure, as created by a CollectionView according to a GroupDescription. // CollectionView classes use this class to manage all Grouping functionality. // // See spec at [....]/connecteddata/Specs/Grouping.mht // //--------------------------------------------------------------------------- using System; using System.Collections; // IComparer using System.Collections.ObjectModel; // ObservableCollection using System.Collections.Specialized; // INotifyCollectionChanged using System.ComponentModel; // PropertyChangedEventArgs, GroupDescription using System.Globalization; using System.Windows.Data; // CollectionViewGroup namespace MS.Internal.Data { // CollectionView classes use this class as the manager of all Grouping functionality internal class CollectionViewGroupRoot : CollectionViewGroupInternal, INotifyCollectionChanged { internal CollectionViewGroupRoot(CollectionView view) : base("Root", null) { _view = view; } #region INotifyCollectionChanged ////// Raise this event when the (grouped) view changes /// public event NotifyCollectionChangedEventHandler CollectionChanged; ////// Notify listeners that this View has changed /// ////// CollectionViews (and sub-classes) should take their filter/sort/grouping /// into account before calling this method to forward CollectionChanged events. /// /// /// The NotifyCollectionChangedEventArgs to be passed to the EventHandler /// public void OnCollectionChanged(NotifyCollectionChangedEventArgs args) { if (args == null) throw new ArgumentNullException("args"); if (CollectionChanged != null) CollectionChanged(this, args); } #endregion INotifyCollectionChanged ////// The description of grouping, indexed by level. /// public virtual ObservableCollectionGroupDescriptions { get { return _groupBy; } } /// /// A delegate to select the group description as a function of the /// parent group and its level. /// public virtual GroupDescriptionSelectorCallback GroupBySelector { get { return _groupBySelector; } set { _groupBySelector = value; } } // a group description has changed somewhere in the tree - notify host protected override void OnGroupByChanged() { if (GroupDescriptionChanged != null) GroupDescriptionChanged(this, EventArgs.Empty); } #region Internal Events and Properties internal event EventHandler GroupDescriptionChanged; internal IComparer ActiveComparer { get { return _comparer; } set { _comparer = value; } } ////// Culture to use during sorting. /// internal CultureInfo Culture { get { return _view.Culture; } } internal bool IsDataInGroupOrder { get { return _isDataInGroupOrder; } set { _isDataInGroupOrder = value; } } #endregion Internal Events and Properties #region Internal Methods internal void Initialize() { if (_topLevelGroupDescription == null) { _topLevelGroupDescription = new TopLevelGroupDescription(); } InitializeGroup(this, _topLevelGroupDescription, 0); } internal void AddToSubgroups(object item, bool loading) { AddToSubgroups(item, this, 0, loading); } internal bool RemoveFromSubgroups(object item) { return RemoveFromSubgroups(item, this, 0); } internal void RemoveItemFromSubgroupsByExhaustiveSearch(object item) { RemoveItemFromSubgroupsByExhaustiveSearch(this, item); } #endregion Internal Methods #region private methods // Initialize the given group void InitializeGroup(CollectionViewGroupInternal group, GroupDescription parentDescription, int level) { // set the group description for dividing the group into subgroups GroupDescription groupDescription = GetGroupDescription(group, parentDescription, level); group.GroupBy = groupDescription; // create subgroups for each of the explicit names ObservableCollection
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AssertFilter.cs
- TypeListConverter.cs
- ProjectionCamera.cs
- ComponentResourceKeyConverter.cs
- CodeEventReferenceExpression.cs
- KeyboardDevice.cs
- MULTI_QI.cs
- StackOverflowException.cs
- Int64KeyFrameCollection.cs
- XmlNamespaceMapping.cs
- XmlParserContext.cs
- PolicyConversionContext.cs
- FillRuleValidation.cs
- TextPenaltyModule.cs
- FixedPageAutomationPeer.cs
- PublisherIdentityPermission.cs
- SingleObjectCollection.cs
- PreDigestedSignedInfo.cs
- GridToolTip.cs
- BigInt.cs
- arabicshape.cs
- BlockUIContainer.cs
- Page.cs
- SerialPinChanges.cs
- PeerCustomResolverSettings.cs
- SafeLocalMemHandle.cs
- CommandBinding.cs
- VisualStyleInformation.cs
- WebWorkflowRole.cs
- TemplateColumn.cs
- ToolboxControl.cs
- ReadOnlyPropertyMetadata.cs
- InstanceDataCollectionCollection.cs
- SrgsText.cs
- XmlFormatExtensionPointAttribute.cs
- Boolean.cs
- WeakEventManager.cs
- XpsFilter.cs
- RadioButton.cs
- SQLGuid.cs
- PermissionSetTriple.cs
- Token.cs
- MSAANativeProvider.cs
- RegionData.cs
- PixelFormatConverter.cs
- BitmapEffectDrawingContextWalker.cs
- columnmapkeybuilder.cs
- UnSafeCharBuffer.cs
- SqlDataSourceCustomCommandPanel.cs
- XmlAnyElementAttribute.cs
- DataGridViewColumnTypePicker.cs
- SparseMemoryStream.cs
- OleDbRowUpdatingEvent.cs
- LinqDataSourceHelper.cs
- FirstMatchCodeGroup.cs
- ChannelTracker.cs
- AttributeCollection.cs
- UiaCoreTypesApi.cs
- CompoundFileStreamReference.cs
- CombinedTcpChannel.cs
- MessageSmuggler.cs
- AnimationException.cs
- Trigger.cs
- CommunicationObjectAbortedException.cs
- SeverityFilter.cs
- String.cs
- ArrangedElement.cs
- RegularExpressionValidator.cs
- ToolStripRenderer.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- PageSetupDialog.cs
- SymmetricAlgorithm.cs
- SurrogateDataContract.cs
- TextComposition.cs
- HashStream.cs
- AesCryptoServiceProvider.cs
- SessionStateUtil.cs
- SchemaNames.cs
- XmlSerializer.cs
- HierarchicalDataTemplate.cs
- PersonalizationState.cs
- ExtendedProperty.cs
- WindowsListViewGroupHelper.cs
- TreeViewItem.cs
- DifferencingCollection.cs
- InvalidProgramException.cs
- LinqDataSourceEditData.cs
- NativeMethods.cs
- RequestQueue.cs
- SqlReorderer.cs
- ResourceExpressionBuilder.cs
- UIPropertyMetadata.cs
- DisplayInformation.cs
- PolygonHotSpot.cs
- X509Extension.cs
- Timer.cs
- Track.cs
- CollectionViewGroupRoot.cs
- UIPermission.cs
- ListBindingHelper.cs