Click or drag to resize

PartitionableListT Class

List of items of class T. From this list partitions can be created, which basically are views inside this list, which have certain selection criterions. See remarks for details.
Inheritance Hierarchy

Namespace: Altaxo.Collections
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public class PartitionableList<T> : ObservableCollection<T>

Type Parameters

T
Type of the items in the list.

The PartitionableListT type exposes the following members.

Constructors
 NameDescription
Public methodPartitionableListTInitializes a new instance of the PartitionableListT class
Public methodPartitionableListT(ActionT)Initializes a new instance of the PartitionableListT class
Top
Properties
 NameDescription
Public propertyCountGets the number of elements actually contained in the CollectionT.
(Inherited from CollectionT)
Public propertyItemGets or sets the element at the specified index.
(Inherited from CollectionT)
Protected propertyItemsGets a IListT wrapper around the CollectionT.
(Inherited from CollectionT)
Top
Methods
 NameDescription
Public methodAddAdds an object to the end of the CollectionT.
(Inherited from CollectionT)
Public methodAddRange 
Protected methodBlockReentrancyDisallows reentrant attempts to change this collection.
(Inherited from ObservableCollectionT)
Protected methodCheckReentrancyChecks for reentrant attempts to change this collection.
(Inherited from ObservableCollectionT)
Public methodClearRemoves all elements from the CollectionT.
(Inherited from CollectionT)
Protected methodClearItems
(Overrides ObservableCollectionTClearItems)
Public methodContainsDetermines whether an element is in the CollectionT.
(Inherited from CollectionT)
Public methodCopyToCopies the entire CollectionT to a compatible one-dimensional Array, starting at the specified index of the target array.
(Inherited from CollectionT)
Public methodCreatePartialView(FuncT, Boolean) Creates a partial view. A partial view is a view of the list of items of the original collection, that fulfill a certain condition.
Public methodCreatePartialView(FuncT, Boolean, ActionT) Creates a partial view. A partial view is a view of the list of items of the original collection, that fulfill a certain condition.
Public methodCreatePartialViewOfTypeM Creates the partial view that consists of all elements in the original collection that are of type M.
Public methodCreatePartialViewOfTypeM(ActionM) Creates the partial view that consists of all elements in the original collection that are of type M.
Public methodCreatePartialViewOfTypeM(FuncM, Boolean) Creates the partial view that consisist of elements of type M that fullfil a given condition.
Public methodCreatePartialViewOfTypeM(FuncM, Boolean, ActionM) Creates the partial view that consisist of elements of type M that fullfil a condition provided by the argument selectionCriterium.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetEnumeratorReturns an enumerator that iterates through the CollectionT.
(Inherited from CollectionT)
Public methodGetEventDisableToken Gets a token that will temporarily disable the CollectionChanged events from this collection. The best practice is to use this token inside a using statement, because at the end of the using statement the Dispose function of the token is called automatically, which then reenables the events.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIndexOfSearches for the specified object and returns the zero-based index of the first occurrence within the entire CollectionT.
(Inherited from CollectionT)
Public methodInsertInserts an element into the CollectionT at the specified index.
(Inherited from CollectionT)
Protected methodInsertItem
(Overrides ObservableCollectionTInsertItem(Int32, T))
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodMoveMoves the item at the specified index to a new location in the collection.
(Inherited from ObservableCollectionT)
Protected methodMoveItem
(Overrides ObservableCollectionTMoveItem(Int32, Int32))
Protected methodNotifyPartialViewsThatHaveChanged Notifies the partial views that have changed after each operation.
Protected methodOnCollectionChanged
(Overrides ObservableCollectionTOnCollectionChanged(NotifyCollectionChangedEventArgs))
Protected methodOnPropertyChangedRaises the PropertyChanged event with the provided arguments.
(Inherited from ObservableCollectionT)
Protected methodOnReenableEvents 
Public methodRemoveRemoves the first occurrence of a specific object from the CollectionT.
(Inherited from CollectionT)
Public methodRemoveAtRemoves the element at the specified index of the CollectionT.
(Inherited from CollectionT)
Protected methodRemoveItem
(Overrides ObservableCollectionTRemoveItem(Int32))
Protected methodSetItem
(Overrides ObservableCollectionTSetItem(Int32, T))
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Events
 NameDescription
Public eventCollectionChangedOccurs when an item is added, removed, changed, moved, or the entire list is refreshed.
(Inherited from ObservableCollectionT)
Protected eventPropertyChangedOccurs when a property value changes.
(Inherited from ObservableCollectionT)
Top
Fields
 NameDescription
Protected field_actionBeforeInsertion Defines an action that is executed before an item is inserted. The 1st argument is the item to insert.
Protected field_eventState Get information whether the CollectionChanged events are enabled or disabled.
Protected field_partialViewsContains all partial views that were created for this instance and are still alive.
Protected field_partialViewsToNotify The partial views that need to notify after modifications that they have changed.
Top
Extension Methods
 NameDescription
Public Extension MethodAddRangeT
(Defined by ListExtensions)
Public Extension MethodFillWithT
(Defined by ListExtensions)
Top
Remarks
Say you have two classes, A and B, both having the base class T. Then you can create a PartionableList, holding items of class A as well as items of class B. From this list you then can create a partition, i.e. a view, that shows only items of class A, and another partition, that shows only items of class B. These partitions support all list operations, including deletion, insertion, movement, and setting of items. These list operations are propagated to the main list. Of course, it will cause an exception if you try to insert items of class B into the partition of class A (and vice versa). When you set or insert an item in a partition, that item has to fulfill the selection criterion for the particular partition.
See Also