Search Results for

    Show / Hide Table of Contents

    Class BaseHasChildren<T>

    A base class that items can inherit from that implements the IHasChildren<T> functionality

    Inheritance
    object
    BaseHasChildren<T>
    EntityImportColDefinition
    EPCommand
    BaseTreeNode<T, TN>
    QueryableFilter
    TreeNode
    Implements
    IHasChildren<T>
    IHasChildren
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Utils
    Assembly: LemonEdge.Utils.dll
    Syntax
    [DataContract(IsReference = true)]
    public abstract class BaseHasChildren<T> : IHasChildren<T>, IHasChildren where T : BaseHasChildren<T>
    Type Parameters
    Name Description
    T

    The type that all Child items are of, and this item itself is. The type must implement BaseHasChildren<T>

    Constructors

    BaseHasChildren()

    Creates a new BaseHasChildren

    Declaration
    public BaseHasChildren()

    BaseHasChildren(Func<T, int>)

    Creates a new BaseHasChildren with a function that specifies certain ordering to be used for all the Child Items

    Declaration
    public BaseHasChildren(Func<T, int> getOrder)
    Parameters
    Type Name Description
    Func<T, int> getOrder

    A function that given a child item returns the order it should be enumerated in when enumerating Children

    BaseHasChildren(Func<T, int>, T)

    Creates a new BaseHasChildren with a function that specifies certain ordering to be used for all the Child Items, and which item is the parent of this item itself

    Declaration
    protected BaseHasChildren(Func<T, int> getOrder, T parent)
    Parameters
    Type Name Description
    Func<T, int> getOrder

    A function that given a child item returns the order it should be enumerated in when enumerating Children

    T parent

    The BasHasChildren item that is the parent item of this one, and this contains it in its Children collection

    BaseHasChildren(T)

    Creates a new BaseHasChildren item with the specified BaseHasChildren item as its Parent item

    Declaration
    protected BaseHasChildren(T parent)
    Parameters
    Type Name Description
    T parent

    The BasHasChildren item that is the parent item of this one, and this contains it in its Children collection

    Properties

    Children

    All Child items in this item. If this has a Order, then this is enumerated according to that order

    Declaration
    public virtual IEnumerable<T> Children { get; }
    Property Value
    Type Description
    IEnumerable<T>

    Order

    A function that returns the order a given child item should appear in when enumerating the Children collection

    Declaration
    protected Func<T, int> Order { get; }
    Property Value
    Type Description
    Func<T, int>

    Parent

    Holds a link to the parent item (if there is one) that this item is a child of

    Declaration
    public T Parent { get; }
    Property Value
    Type Description
    T

    Methods

    AddChild(IHasChildren)

    Adds a child item to the collection of Children in this item

    Declaration
    public void AddChild(IHasChildren item)
    Parameters
    Type Name Description
    IHasChildren item

    The item to add to this items Children. It can not already have another Parent, and this method will set its Parent to this item itself

    AddChild(T, bool)

    Adds a child item to the collection of Children in this item

    Declaration
    public void AddChild(T item, bool allowDuplicate = false)
    Parameters
    Type Name Description
    T item

    The item to add to this items Children. It can not already have another Parent, and this method will set its Parent to this item itself

    bool allowDuplicate
    Exceptions
    Type Condition
    ArgumentException

    If the item to be added already has another Parent an exception is thrown

    ClearChildren()

    Clears all children contained within this item

    Declaration
    public void ClearChildren()

    ClearMyParent()

    Declaration
    protected void ClearMyParent()

    DeleteChild(IHasChildren)

    Removes a child item from the collection of Children in this item

    Declaration
    public void DeleteChild(IHasChildren item)
    Parameters
    Type Name Description
    IHasChildren item

    The item to remove from this items Children

    DeleteChild(T)

    Removes a child item from the collection of Children in this item

    Declaration
    public void DeleteChild(T item)
    Parameters
    Type Name Description
    T item

    The item to remove from this items Children

    Implements

    IHasChildren<T>
    IHasChildren

    Extension Methods

    HasChildrenExtensions.ContainsMatchingNode<T>(T, Func<T, bool>)
    HasChildrenExtensions.CopyNode<T>(T, T, HasChildrenExtensions.CreateCopiedNode<T>)
    HasChildrenExtensions.CopyNode<T>(T, HasChildrenExtensions.CreateCopiedNode<T>)
    HasChildrenExtensions.GetLeafChildNodesOnly<T>(T)
    HasChildrenExtensions.GetMatchingNode<T>(T, Func<T, bool>)
    HasChildrenExtensions.GetPath<T>(T, string, Func<T, string>)
    HasChildrenExtensions.GetRootParent<T>(T)
    HasChildrenExtensions.GetRootToNode<T>(T)
    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    HasChildrenExtensions.GetAllChildren(IHasChildren)
    HasChildrenExtensions.GetLeafChildNodesOnly(IHasChildren)
    HasChildrenExtensions.GetRootParent(IHasChildren)
    HasChildrenExtensions.HasChildren(IHasChildren)
    HasChildrenExtensions.MaxTreeDepth(IHasChildren)
    HasChildrenExtensions.GetAllChildren<T>(IHasChildren<T>)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)

    See Also

    IHasChildren
    IHasChildren<T>
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.