Search Results for

    Show / Hide Table of Contents

    Struct LinksGroup<TLinkAddress>

    Represents a group of links with hierarchical structure, where each group contains a primary link and optional nested groups. This structure supports the indentation-based syntax of the Lino protocol.

    Implements
    IEquatable<LinksGroup<TLinkAddress>>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Platform.Protocols.Lino
    Assembly: Platform.Protocols.Lino.dll
    Syntax
    public struct LinksGroup<TLinkAddress> : IEquatable<LinksGroup<TLinkAddress>>
    Type Parameters
    Name Description
    TLinkAddress

    The type used for link addresses/identifiers. This can be any type that uniquely identifies a link, such as string, int, or Guid.

    Constructors

    | Edit this page View Source

    LinksGroup(Link<TLinkAddress>)

    Initializes a new links group with the specified link and no nested groups.

    Declaration
    public LinksGroup(Link<TLinkAddress> link)
    Parameters
    Type Name Description
    Link<TLinkAddress> link

    The primary link of this group.

    | Edit this page View Source

    LinksGroup(Link<TLinkAddress>, IList<LinksGroup<TLinkAddress>>?)

    Initializes a new links group with the specified link and nested groups.

    Declaration
    public LinksGroup(Link<TLinkAddress> link, IList<LinksGroup<TLinkAddress>>? groups)
    Parameters
    Type Name Description
    Link<TLinkAddress> link

    The primary link of this group.

    IList<LinksGroup<TLinkAddress>> groups

    The nested groups within this group.

    Properties

    | Edit this page View Source

    Groups

    Gets or sets the collection of nested groups within this group. Can be null if no nested groups exist.

    Declaration
    public IList<LinksGroup<TLinkAddress>>? Groups { readonly get; set; }
    Property Value
    Type Description
    IList<LinksGroup<TLinkAddress>>
    | Edit this page View Source

    Link

    Gets or sets the primary link of this group.

    Declaration
    public Link<TLinkAddress> Link { readonly get; set; }
    Property Value
    Type Description
    Link<TLinkAddress>

    Methods

    | Edit this page View Source

    AppendToLinksList(List<Link<TLinkAddress>>)

    Appends this links group to the specified list as flattened links.

    Declaration
    public void AppendToLinksList(List<Link<TLinkAddress>> list)
    Parameters
    Type Name Description
    List<Link<TLinkAddress>> list

    The list to append the links to.

    | Edit this page View Source

    AppendToLinksList(List<Link<TLinkAddress>>, Link<TLinkAddress>, LinksGroup<TLinkAddress>)

    Recursively appends a links group to a list, combining dependencies with nested groups to create a flattened structure.

    Declaration
    public static void AppendToLinksList(List<Link<TLinkAddress>> list, Link<TLinkAddress> dependency, LinksGroup<TLinkAddress> group)
    Parameters
    Type Name Description
    List<Link<TLinkAddress>> list

    The list to append the links to.

    Link<TLinkAddress> dependency

    The dependency link to combine with nested groups.

    LinksGroup<TLinkAddress> group

    The links group to process.

    | Edit this page View Source

    Equals(LinksGroup<TLinkAddress>)

    Indicates whether the current links group is equal to another links group.

    Declaration
    public bool Equals(LinksGroup<TLinkAddress> other)
    Parameters
    Type Name Description
    LinksGroup<TLinkAddress> other

    The links group to compare with this links group.

    Returns
    Type Description
    bool

    True if the current links group is equal to the other parameter; otherwise, false.

    | Edit this page View Source

    Equals(object?)

    Determines whether the specified object is equal to this links group.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with this links group.

    Returns
    Type Description
    bool

    True if the specified object is equal to this links group; otherwise, false.

    Overrides
    ValueType.Equals(object)
    | Edit this page View Source

    GetHashCode()

    Returns the hash code for this links group.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for this links group.

    Overrides
    ValueType.GetHashCode()
    | Edit this page View Source

    ToLinksList()

    Converts this links group to a flat list of links, preserving the hierarchical relationships.

    Declaration
    public List<Link<TLinkAddress>> ToLinksList()
    Returns
    Type Description
    List<Link<TLinkAddress>>

    A list of links representing the flattened structure of this group.

    Operators

    | Edit this page View Source

    operator ==(LinksGroup<TLinkAddress>, LinksGroup<TLinkAddress>)

    Determines whether two links group instances are equal.

    Declaration
    public static bool operator ==(LinksGroup<TLinkAddress> left, LinksGroup<TLinkAddress> right)
    Parameters
    Type Name Description
    LinksGroup<TLinkAddress> left

    The first links group to compare.

    LinksGroup<TLinkAddress> right

    The second links group to compare.

    Returns
    Type Description
    bool

    True if the links groups are equal; otherwise, false.

    | Edit this page View Source

    implicit operator List<Link<TLinkAddress>>(LinksGroup<TLinkAddress>)

    Implicitly converts a links group to a list of links by flattening the hierarchical structure.

    Declaration
    public static implicit operator List<Link<TLinkAddress>>(LinksGroup<TLinkAddress> value)
    Parameters
    Type Name Description
    LinksGroup<TLinkAddress> value

    The links group to convert.

    Returns
    Type Description
    List<Link<TLinkAddress>>
    | Edit this page View Source

    operator !=(LinksGroup<TLinkAddress>, LinksGroup<TLinkAddress>)

    Determines whether two links group instances are not equal.

    Declaration
    public static bool operator !=(LinksGroup<TLinkAddress> left, LinksGroup<TLinkAddress> right)
    Parameters
    Type Name Description
    LinksGroup<TLinkAddress> left

    The first links group to compare.

    LinksGroup<TLinkAddress> right

    The second links group to compare.

    Returns
    Type Description
    bool

    True if the links groups are not equal; otherwise, false.

    Implements

    IEquatable<T>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX