Show / Hide Table of Contents

Interface ITreeNode<T>

Interface representing a tree node.

Inherited Members
System.IDisposable.Dispose()
System.Collections.Generic.IEnumerable<Extend.ITreeNode<T>>.GetEnumerator()
Namespace:Extend
Assembly:Extend.dll
Syntax
public interface ITreeNode<T> : IDisposable, IEnumerable<ITreeNode<T>>, IEnumerable
Type Parameters
Name Description
T The type of the node's value.

Properties

| Improve this Doc View Source

AncestorsTraversalDirection

Gets or sets the ancestors traversal direction.

Declaration
TreeTraversalDirection AncestorsTraversalDirection { get; set; }
Property Value
Type Description
TreeTraversalDirection

The ancestors traversal direction.

| Improve this Doc View Source

Children

Gets the children of the node.

Declaration
ITreeNodeCollection<T> Children { get; set; }
Property Value
Type Description
ITreeNodeCollection<T><T>

The children of the node.

| Improve this Doc View Source

Depth

Gets the depth of the node.

Declaration
int Depth { get; }
Property Value
Type Description
System.Int32

The depth of the node.

| Improve this Doc View Source

Descendants

Gets an enumeration of all tree nodes which are below the current node in the tree.

Declaration
IEnumerable<ITreeNode<T>> Descendants { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><ITreeNode<T><T>>

An enumeration of all tree nodes which are below the current node in the tree.

| Improve this Doc View Source

DescendantsTraversalDirection

Gets or sets the descendants traversal direction.

Declaration
TreeTraversalDirection DescendantsTraversalDirection { get; set; }
Property Value
Type Description
TreeTraversalDirection

The descendants traversal direction.

| Improve this Doc View Source

DisposeTraversalDirection

Gets or sets the dispose traversal direction.

Declaration
TreeTraversalDirection DisposeTraversalDirection { get; set; }
Property Value
Type Description
TreeTraversalDirection

The dispose traversal direction.

| Improve this Doc View Source

HasChildren

Gets a value indicating whether the node has any children or not.

Declaration
bool HasChildren { get; }
Property Value
Type Description
System.Boolean

A value indicating whether the node has any children or not.

| Improve this Doc View Source

HasParent

Gets a value indicating whether the node has a parent or not.

Declaration
bool HasParent { get; }
Property Value
Type Description
System.Boolean

A value indicating whether the node has a parent or not.

| Improve this Doc View Source

Parent

Gets or sets the parent of the node.

Declaration
ITreeNode<T> Parent { get; set; }
Property Value
Type Description
ITreeNode<T><T>

The parent of the node.

| Improve this Doc View Source

Root

Gets the root of the tree.

Declaration
ITreeNode<T> Root { get; }
Property Value
Type Description
ITreeNode<T><T>

The root of the tree.

| Improve this Doc View Source

SearchTraversalDirection

Gets or sets the search traversal direction.

Declaration
TreeTraversalDirection SearchTraversalDirection { get; set; }
Property Value
Type Description
TreeTraversalDirection

The search traversal direction.

| Improve this Doc View Source

TraversalDirection

Gets or sets the traversal direction used to enumerate the nodes.

Declaration
TreeTraversalDirection TraversalDirection { get; set; }
Property Value
Type Description
TreeTraversalDirection

The traversal direction used to enumerate the nodes.

| Improve this Doc View Source

Value

Gets or sets the value of the node.

Declaration
T Value { get; set; }
Property Value
Type Description
T

The value of the node.

Methods

| Improve this Doc View Source

Add(T)

Adds the given value as child to the node.

Declaration
ITreeNode<T> Add(T value)
Parameters
Type Name Description
T value

The value to add.

Returns
Type Description
ITreeNode<T><T>

Returns the added node.

| Improve this Doc View Source

Add(ITreeNode<T>)

Adds the given node as child to the node, if it is not already a child of the node.

Declaration
ITreeNode<T> Add(ITreeNode<T> node)
Parameters
Type Name Description
ITreeNode<T><T> node

The node to add.

Returns
Type Description
ITreeNode<T><T>

Returns the added node.

| Improve this Doc View Source

FindNode(T)

Gets the nodes with the given value.

Declaration
IEnumerable<ITreeNode<T>> FindNode(T value)
Parameters
Type Name Description
T value

The value to search.

Returns
Type Description
System.Collections.Generic.IEnumerable<T><ITreeNode<T><T>>

Returns the nodes with the given value.

| Improve this Doc View Source

FindNode(Func<ITreeNode<T>, Boolean>)

Gets the nodes which matches the given predicate.

Declaration
IEnumerable<ITreeNode<T>> FindNode(Func<ITreeNode<T>, bool> predicate)
Parameters
Type Name Description
System.Func<T, TResult><ITreeNode<T><T>, System.Boolean> predicate

The predicate.

Returns
Type Description
System.Collections.Generic.IEnumerable<T><ITreeNode<T><T>>

Returns the nodes which matches the given predicate.

Remarks

Starts the search at the current tree node and traverses down the tree (Direction based on

SearchTraversalDirection).

Exceptions
Type Condition
System.ArgumentNullException

predicate can not be null.

| Improve this Doc View Source

FindValue(Func<ITreeNode<T>, Boolean>)

Gets the values which matches the given predicate.

Declaration
IEnumerable<T> FindValue(Func<ITreeNode<T>, bool> predicate)
Parameters
Type Name Description
System.Func<T, TResult><ITreeNode<T><T>, System.Boolean> predicate

The predicate.

Returns
Type Description
System.Collections.Generic.IEnumerable<T><T>

Returns the values which matches the given predicate.

Remarks

Starts the search at the current tree node and traverses down the tree (Direction based on

SearchTraversalDirection).

Exceptions
Type Condition
System.ArgumentNullException

predicate can not be null.

| Improve this Doc View Source

SetAllDirections(TreeTraversalDirection)

Sets all directions (DisposeTraversalDirection, SearchTraversalDirection,

AncestorsTraversalDirection, DescendantsTraversalDirection).

Declaration
void SetAllDirections(TreeTraversalDirection direction)
Parameters
Type Name Description
TreeTraversalDirection direction

The new direction.

| Improve this Doc View Source

SetParent(ITreeNode<T>, Boolean, Boolean)

Sets the parent of the tree node.

Declaration
void SetParent(ITreeNode<T> parent, bool attacheToNewParent = true, bool detachFromOldParent = true)
Parameters
Type Name Description
ITreeNode<T><T> parent

The new parent.

System.Boolean attacheToNewParent

A value determining whether the node should add it self to the children of the new parent or not.

System.Boolean detachFromOldParent

A value indicating whether the node should detach itself from it's old parent or not.

Remarks

TODO: add test for detachFromOldParent

Extension Methods

IEnumerableTEx.Intersect<TSource, TKey>(IEnumerable<TSource>, IEnumerable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>)
IEnumerableTEx.GetEqualItemsFromStart<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)
IEnumerableTEx.Except<TSource, TKey>(IEnumerable<TSource>, IEnumerable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>)
IEnumerableTEx.Partition<T>(IEnumerable<T>, Int32)
IEnumerableTEx.WithIndex<T>(IEnumerable<T>)
IEnumerableTEx.Prepend<T>(IEnumerable<T>, T)
IEnumerableTEx.Append<T>(IEnumerable<T>, T)
IEnumerableTEx.GetRandomItem<T>(IEnumerable<T>)
IEnumerableTEx.WhereNot<T>(IEnumerable<T>, ISpecification<T>)
IEnumerableTEx.Where<T>(IEnumerable<T>, ISpecification<T>)
IEnumerableTEx.SpecificationForItems<T>(IEnumerable<T>, Func<T, Boolean>, String)
IEnumerableTEx.EnsureNotNull<T>(IEnumerable<T>)
IEnumerableTEx.IsNullOrEmpty<T>(IEnumerable<T>)
IEnumerableTEx.ContainsAll<T>(IEnumerable<T>, T[])
IEnumerableTEx.ContainsAll<T>(IEnumerable<T>, IEnumerable<T>)
IEnumerableTEx.ContainsAny<T>(IEnumerable<T>, T[])
IEnumerableTEx.ContainsAny<T>(IEnumerable<T>, IEnumerable<T>)
IEnumerableTEx.ForEach<T>(IEnumerable<T>, Action<T>)
IEnumerableTEx.ForEach<T>(IEnumerable<T>, Action<T, Int32>)
IEnumerableTEx.ForEachReverse<T>(IEnumerable<T>, Action<T>)
IEnumerableTEx.NotAny<T>(IEnumerable<T>)
IEnumerableTEx.NotAny<T>(IEnumerable<T>, Func<T, Boolean>)
IEnumerableTEx.AnyAndNotNull<T>(IEnumerable<T>)
IEnumerableTEx.AnyAndNotNull<T>(IEnumerable<T>, Func<T, Boolean>)
IEnumerableTEx.StringJoin<T>(IEnumerable<T>, String)
IEnumerableTEx.StringJoin<T>(IEnumerable<T>, Func<T, String>, String)
IEnumerableTEx.WhereIf<T>(IEnumerable<T>, Boolean, Func<T, Boolean>)
IEnumerableTEx.WhereIf<T>(IEnumerable<T>, Boolean, Func<T, Int32, Boolean>)
IEnumerableTEx.Randomize<T>(IEnumerable<T>)
IEnumerableTEx.Distinct<T, TKey>(IEnumerable<T>, Func<T, TKey>)
IEnumerableTEx.ToObservableCollection<T>(IEnumerable<T>)
IEnumerableTEx.Many<T>(IEnumerable<T>, Func<T, Boolean>)
IEnumerableTEx.Many<T>(IEnumerable<T>)
IEnumerableTEx.MinimumOf<T>(IEnumerable<T>, Int32, Func<T, Boolean>)
IEnumerableTEx.MinimumOf<T>(IEnumerable<T>, Int32)
IEnumerableTEx.TakeUntil<T>(IEnumerable<T>, Func<T, Boolean>)
ObjectEx.SatisfiesWithMessages<T>(T, ISpecification<T>)
ObjectEx.Specification<T>(T, Func<T, Boolean>, String)
ObjectEx.GetNameChain<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>)
ObjectEx.GetNameChain<TObject, TMember>(TObject, Expression<Func<TMember>>)
ObjectEx.Swap<T>(Object, ref T, ref T)
ObjectEx.ToSingleItemArray<T>(T)
ObjectEx.Maximum<TSource>(TSource, TSource[])
ObjectEx.Maximum<TSource, TResult>(TSource, Func<TSource, TResult>, TSource[])
ObjectEx.Minimum<TSource>(TSource, TSource[])
ObjectEx.Minimum<TSource, TResult>(TSource, Func<TSource, TResult>, TSource[])
ObjectEx.Satisfies<T>(T, ISpecification<T>)
ObjectEx.IfNull<T>(T, T)
ObjectEx.ThrowIfNull<TObject>(TObject, Expression<Func<TObject>>, String)
ObjectEx.ThrowIfNull<TObject>(TObject, String, String)
ObjectEx.GetName<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>)
ObjectEx.GetName<TObject, TMember>(TObject, Expression<Func<TMember>>)
ObjectEx.IsNull(Object)
ObjectEx.IsNotNull(Object)
ObjectEx.As<T>(Object)
ObjectEx.Chain<T>(T, Action<T>)
ObjectEx.RefEquals(Object, Object)
ObjectEx.Coalesce<T>(T, T[])
ObjectEx.Coalesce<T>(T, T)
ObjectEx.CoalesceOrDefault<T>(T, T, T[])
ObjectEx.CoalesceOrDefault<T>(T, Func<T>, T[])
ObjectEx.ExecuteSafe<T>(T, Action<T>)
ObjectEx.ExecuteSafe<T, TResult>(T, Func<T, TResult>)
ObjectEx.ToBoolean(Object)
ObjectEx.ToBoolean(Object, IFormatProvider)
ObjectEx.ToByte(Object)
ObjectEx.ToByte(Object, IFormatProvider)
ObjectEx.ToChar(Object)
ObjectEx.ToChar(Object, IFormatProvider)
ObjectEx.ToDateTime(Object)
ObjectEx.ToDateTime(Object, IFormatProvider)
ObjectEx.ToDecimal(Object)
ObjectEx.ToDecimal(Object, IFormatProvider)
ObjectEx.ToDouble(Object)
ObjectEx.ToDouble(Object, IFormatProvider)
ObjectEx.ToInt32(Object)
ObjectEx.ToInt32(Object, IFormatProvider)
ObjectEx.ToInt16(Object)
ObjectEx.ToInt16(Object, IFormatProvider)
ObjectEx.ToInt64(Object)
ObjectEx.ToInt64(Object, IFormatProvider)
ObjectEx.IsIn<T>(T, T[])
ObjectEx.IsIn<T>(T, IEnumerable<T>)
ObjectEx.IsNotIn<T>(T, T[])
ObjectEx.IsNotIn<T>(T, IEnumerable<T>)
ObjectEx.IsDefault<T>(T)
DecimalEx.Sum<TSource>(TSource, Func<TSource, Decimal>, TSource[])
DecimalEx.Sum<TSource>(TSource, Func<TSource, Nullable<Decimal>>, TSource[])
DoubleEx.Sum<TSource>(TSource, Func<TSource, Double>, TSource[])
DoubleEx.Sum<TSource>(TSource, Func<TSource, Nullable<Double>>, TSource[])
Int32Ex.Sum<TSource>(TSource, Func<TSource, Int32>, TSource[])
Int32Ex.Sum<TSource>(TSource, Func<TSource, Nullable<Int32>>, TSource[])
Int64Ex.Sum<TSource>(TSource, Func<TSource, Int64>, TSource[])
Int64Ex.Sum<TSource>(TSource, Func<TSource, Nullable<Int64>>, TSource[])
  • Improve this Doc
  • View Source
In This Article
  • Properties
    • AncestorsTraversalDirection
    • Children
    • Depth
    • Descendants
    • DescendantsTraversalDirection
    • DisposeTraversalDirection
    • HasChildren
    • HasParent
    • Parent
    • Root
    • SearchTraversalDirection
    • TraversalDirection
    • Value
  • Methods
    • Add(T)
    • Add(ITreeNode<T>)
    • FindNode(T)
    • FindNode(Func<ITreeNode<T>, Boolean>)
    • FindValue(Func<ITreeNode<T>, Boolean>)
    • SetAllDirections(TreeTraversalDirection)
    • SetParent(ITreeNode<T>, Boolean, Boolean)
  • Extension Methods
Back to top Copyright © 2015-2016 Microsoft
Generated by DocFX