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()
Implements
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
System.Boolean
disposing
|
Finalize()
Declaration
protected 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
ICollection<HierarchicalItem>.Add(HierarchicalItem)
Declaration
void ICollection<HierarchicalItem>.Add(HierarchicalItem item)
Parameters
HierarchicalItem
item
|
Implements
ICollection<HierarchicalItem>.Clear()
Declaration
void ICollection<HierarchicalItem>.Clear()
Implements
ICollection<HierarchicalItem>.Contains(HierarchicalItem)
Declaration
bool ICollection<HierarchicalItem>.Contains(HierarchicalItem item)
Parameters
HierarchicalItem
item
|
Returns
System.Boolean
|
Implements
ICollection<HierarchicalItem>.CopyTo(HierarchicalItem[], Int32)
Declaration
void ICollection<HierarchicalItem>.CopyTo(HierarchicalItem[] array, int arrayIndex)
Parameters
HierarchicalItem[]
array
|
System.Int32
arrayIndex
|
Implements
ICollection<HierarchicalItem>.IsReadOnly
Declaration
bool ICollection<HierarchicalItem>.IsReadOnly { get; }
Returns
System.Boolean
|
Implements
ICollection<HierarchicalItem>.Remove(HierarchicalItem)
Declaration
bool ICollection<HierarchicalItem>.Remove(HierarchicalItem item)
Parameters
HierarchicalItem
item
|
Returns
System.Boolean
|
Implements
IEnumerable<HierarchicalItem>.GetEnumerator()
Returns an enumerator that iterates through the Collection of HierarchicalItem.
Declaration
IEnumerator<HierarchicalItem> IEnumerable<HierarchicalItem>.GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<HierarchicalItem>
An IEnumerator of HierarchicalItem for the IEnumerator of HierarchicalItem. |
Implements
IList<HierarchicalItem>.IndexOf(HierarchicalItem)
Declaration
int IList<HierarchicalItem>.IndexOf(HierarchicalItem item)
Parameters
HierarchicalItem
item
|
Returns
System.Int32
|
Implements
IList<HierarchicalItem>.Insert(Int32, HierarchicalItem)
Declaration
void IList<HierarchicalItem>.Insert(int index, HierarchicalItem item)
Parameters
System.Int32
index
|
HierarchicalItem
item
|
Implements
IList<HierarchicalItem>.RemoveAt(Int32)
Declaration
void IList<HierarchicalItem>.RemoveAt(int index)
Parameters
System.Int32
index
|
Implements
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
System.Collections.IEnumerator
An System.Collections.IEnumerator object that can be used to iterate through the collection. |
Implements
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
|