Class HierarchicalCollectionAdapter
This class wraps a hierarchical collection with observable collection, containing the flattened items, wrapped in HierarchicalItem. This collection doesn't track the source collection for changes.
Inherited Members
Namespace: Telerik.Windows.Core
Assembly: Telerik.Windows.Scheduling.Core.dll
Syntax
public class HierarchicalCollectionAdapter : PropertyChangedBase, IList<HierarchicalItem>, ICollection<HierarchicalItem>, IEnumerable<HierarchicalItem>, IEnumerable, IDisposable, IHierarchicalItemStateObserver, IHierarchicalCollectionAdapter<HierarchicalItem>, INotifyCollectionChanged, INotifyPropertyChanged, IEditableHierarchical
Constructors
HierarchicalCollectionAdapter(IEnumerable, Func<HierarchicalItem, Boolean>)
Initializes a new instance of the HierarchicalCollectionAdapter class. It doesn't track the source hierarchical collection for changes.
Declaration
public HierarchicalCollectionAdapter(IEnumerable hierarchicalItems, Func<HierarchicalItem, bool> shouldExpandedByDefault)
Parameters
System.Collections.IEnumerable
hierarchicalItems
The hierarchical collection to be flattened. |
System.Func<HierarchicalItem, System.Boolean>
shouldExpandedByDefault
|
Properties
Count
Declaration
public int Count { get; }
Property Value
System.Int32
|
Implements
Item[Int32]
Declaration
public HierarchicalItem this[int index] { get; set; }
Parameters
System.Int32
index
|
Property Value
HierarchicalItem
|
Implements
Methods
CreateWrapper(HierarchicalItem, Object, Int32)
Declaration
protected virtual HierarchicalItem CreateWrapper(HierarchicalItem parent, object item, int sourceIndex)
Parameters
HierarchicalItem
parent
|
System.Object
item
|
System.Int32
sourceIndex
|
Returns
HierarchicalItem
|
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
System.Boolean
disposing
|
Finalize()
Declaration
protected override void Finalize()
GetChildren(Object)
When overridden in the inherited class, this method returns all the children of the provided item.
Declaration
protected virtual IEnumerable GetChildren(object item)
Parameters
System.Object
item
The item, which children are to be retrieved. |
Returns
System.Collections.IEnumerable
All the children of the provided item. |
GetItemWrapperByItemKey(Object)
Declaration
public HierarchicalItem GetItemWrapperByItemKey(object key)
Parameters
System.Object
key
|
Returns
HierarchicalItem
|
Implements
InitializeWrapper(HierarchicalItem, Object)
When overridden in the inherited class, this method is used to perform additional initializations to the newly created wrapper. It is the best place to initialize the IsExpanded and CanExpand properties. This method is called when a new wrapper is initialized. In the base method only the SourceItem is set and an event handler is hooked to the PropertyChanged event to track changes in the IsExpanded property.
Declaration
protected virtual void InitializeWrapper(HierarchicalItem wrapper, object item)
Parameters
HierarchicalItem
wrapper
The wrapper that was created for the item. |
System.Object
item
The item that have been wrapped. |
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Declaration
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
Parameters
System.Collections.Specialized.NotifyCollectionChangedEventArgs
e
|
OnItemPropertyChanged(ItemPropertyChangedEventArgs<HierarchicalItem>)
Declaration
protected virtual void OnItemPropertyChanged(ItemPropertyChangedEventArgs<HierarchicalItem> e)
Parameters
ItemPropertyChangedEventArgs<HierarchicalItem>
e
|
ResetSource(IEnumerable)
Declaration
protected virtual void ResetSource(IEnumerable source)
Parameters
System.Collections.IEnumerable
source
|
SelectKeyForItem(Object)
Declaration
protected virtual object SelectKeyForItem(object item)
Parameters
System.Object
item
|
Returns
System.Object
|
ShouldExpandByDefault(HierarchicalItem)
Declaration
protected bool ShouldExpandByDefault(HierarchicalItem item)
Parameters
HierarchicalItem
item
|
Returns
System.Boolean
|
TakeBetween(Int32, Int32)
Declaration
public IEnumerable<HierarchicalItem> TakeBetween(int startIndex, int endIndex)
Parameters
System.Int32
startIndex
|
System.Int32
endIndex
|
Returns
System.Collections.Generic.IEnumerable<HierarchicalItem>
|
Implements
Events
CollectionChanged
Occurs when the collection changes.
Declaration
public event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
System.Collections.Specialized.NotifyCollectionChangedEventHandler
|
ItemPropertyChanged
Declaration
public event EventHandler<ItemPropertyChangedEventArgs<HierarchicalItem>> ItemPropertyChanged
Event Type
System.EventHandler<ItemPropertyChangedEventArgs<HierarchicalItem>>
|
Explicit Interface Implementations
IEditableHierarchical.InsertChildAtIndex(Object, Int32)
Declaration
void IEditableHierarchical.InsertChildAtIndex(object item, int index)
Parameters
System.Object
item
|
System.Int32
index
|
Implements
IEditableHierarchical.Remove(Object)
Declaration
void IEditableHierarchical.Remove(object item)
Parameters
System.Object
item
|