Show / Hide Table of Contents

    Interface ITreeNode<TItem>

    A node in a tree. A tree is a structure in which every node can have one parent (or no parent if it's the root) and several children (or no children, which will make it a leaf in the tree).

    Inherited Members
    System.IDisposable.Dispose()
    Namespace: AGS.API
    Assembly: AGS.API.dll
    Syntax
    public interface ITreeNode<TItem> : IDisposable where TItem : class, IInTree<TItem>
    Type Parameters
    Name Description
    TItem

    Properties

    | Improve this Doc View Source

    Children

    Gets the items contained in the children.

    Declaration
    IAGSBindingList<TItem> Children { get; }
    Property Value
    Type Description
    IAGSBindingList<TItem>

    The children.

    | Improve this Doc View Source

    ChildrenCount

    Gets the number of children this node has.

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

    The children count.

    | Improve this Doc View Source

    Node

    Gets the item contained in the node.

    Declaration
    TItem Node { get; }
    Property Value
    Type Description
    TItem

    The node.

    | Improve this Doc View Source

    OnParentChanged

    An event which fires whenever the parent for a node changes.

    Declaration
    IBlockingEvent OnParentChanged { get; }
    Property Value
    Type Description
    IBlockingEvent

    The event.

    | Improve this Doc View Source

    Parent

    Gets the item contained in the parent.

    Declaration
    TItem Parent { get; }
    Property Value
    Type Description
    TItem

    The parent.

    Methods

    | Improve this Doc View Source

    AddChild(TItem)

    Adds a child to the node.

    Declaration
    void AddChild(TItem child)
    Parameters
    Type Name Description
    TItem child

    Child.

    | Improve this Doc View Source

    AddChildren(List<TItem>)

    Adds the list of children to the node.

    Declaration
    void AddChildren(List<TItem> children)
    Parameters
    Type Name Description
    System.Collections.Generic.List<TItem> children

    Children.

    | Improve this Doc View Source

    FindDescendant(Predicate<TItem>)

    Find a descendant who matches a specific predicate.

    Declaration
    TItem FindDescendant(Predicate<TItem> isMatch)
    Parameters
    Type Name Description
    System.Predicate<TItem> isMatch

    The predicate.

    Returns
    Type Description
    TItem

    The descendant, or null if not found.

    Examples

    For example, to find a child with a specific id:

    var child = tree.FindDescendant(item => item.Entity.ID == "My ID");
    | Improve this Doc View Source

    FindPreviousSibling(Predicate<TItem>)

    Finds the previous sibling which matches a specific predicate.

    Declaration
    TItem FindPreviousSibling(Predicate<TItem> isMatch)
    Parameters
    Type Name Description
    System.Predicate<TItem> isMatch

    Is match.

    Returns
    Type Description
    TItem

    The previous sibling.

    | Improve this Doc View Source

    GetRoot()

    Returns the root of the tree (the node which has no parent).

    Declaration
    TItem GetRoot()
    Returns
    Type Description
    TItem

    The root.

    | Improve this Doc View Source

    HasChild(TItem)

    Is the specified item a child of this node?

    Declaration
    bool HasChild(TItem child)
    Parameters
    Type Name Description
    TItem child

    Child.

    Returns
    Type Description
    System.Boolean

    true, if it is a child of the node, false otherwise.

    | Improve this Doc View Source

    InsertChild(Int32, TItem)

    Inserts the child to the node at the specified index.

    Declaration
    void InsertChild(int index, TItem child)
    Parameters
    Type Name Description
    System.Int32 index

    Index.

    TItem child

    Child.

    | Improve this Doc View Source

    RemoveChild(TItem)

    Removes the specified child from the node.

    Declaration
    void RemoveChild(TItem child)
    Parameters
    Type Name Description
    TItem child

    Child.

    | Improve this Doc View Source

    SetParent(ITreeNode<TItem>)

    Sets a new parent for the node.

    Declaration
    void SetParent(ITreeNode<TItem> parent)
    Parameters
    Type Name Description
    ITreeNode<TItem> parent

    Parent.

    | Improve this Doc View Source

    StealParent(ITreeNode<TItem>)

    "Steals" the parent from the specified node: this will make this node have the specified node's parent as its parent, and the specified node will remain with no parent.

    Declaration
    void StealParent(ITreeNode<TItem> victim)
    Parameters
    Type Name Description
    ITreeNode<TItem> victim

    Victim.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX