Class TreeItemPool<T, TModel>
- Namespace
- Loehnert.Lisrt.TypeAndResult.VisualTreeHelpers
- Assembly
- Loehnert.Lisrt.TypeAndResult.dll
Represents a recycling pool for TreeItemBase<TModel>.
public class TreeItemPool<T, TModel> where T : TreeItemBase<TModel> where TModel : class
Type Parameters
TTreeItem type.
TModelTreeItem model type.
- Inheritance
-
TreeItemPool<T, TModel>
- Inherited Members
Constructors
TreeItemPool(Func<T>)
Initializes a new instance of the TreeItemPool<T, TModel> class.
public TreeItemPool(Func<T> factoryFunction)
Parameters
factoryFunctionFunc<T>Factory function for a new
T.
Methods
Pop(ITreeItem, TModel)
Pops a recycled or new T by the factory Function.
Model and parent will be set.
public T Pop(ITreeItem parent, TModel model)
Parameters
parentITreeItemParent of the TreeItemBase<TModel>.
modelTModelModel for the TreeItemBase<TModel>.
Returns
- T
A TreeItemBase<TModel> of type
Twith the given model and parent.
Push(T)
public void Push(T item)
Parameters
itemTItem to push.
Exceptions
- ArgumentNullException
Thrown when
itemis null.