<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="../../../design/description.xslt" type="text/xsl"?>
<node lang="en" type="DynamicNode.Lib.Basic.NListItem" assembly="NLibDefault" xmlns="http://dynamicnodes.mastersign.de/description">
  <caption>List Item</caption>
  <group>Basics</group>
  <description>
    Selects an element from an enumerable object. 
    The selection is done absolutely by index or relatively by navigation (forward, backward).
  </description>
  <inPorts>
    <port name="iterable">
      <type>System.Collections.Generic.IEnumerable&lt;TElement&gt;</type>
      <description>The enumerable object to iterate over.</description>
    </port>
    <port name="toBegin">
      <type>&lt;TAny&gt;</type>
      <description>Moves to the first element of the list if a token is received on this in port.</description>
    </port>
    <port name="forward">
      <type>&lt;TAny&gt;</type>
      <description>Moves one element forward in the list if a token is received on this in port.</description>
    </port>
    <port name="backward">
            <type>&lt;TAny&gt;</type>
<description>Moves one element backward in the list if a token is received on this in port.</description>
    </port>
    <port name="toEnd">
      <type>&lt;TAny&gt;</type>
      <description>Moves to the last element of the list if a token is received on this in port.</description>
    </port>
    <port name="indexIn">
      <type>System.Int32</type>
      <description>Moves to the specified position in the list.</description>
    </port>
  </inPorts>
  <outPorts>
    <port name="item">
      <type>TElement</type>
      <description>Emits the current element in the list.</description>
    </port>
    <port name="outOfRange">
      <type>DynamicNode.Core.ControlTrigger</type>
      <description>Emits a trigger token, if a position outisde the list is addressed.</description>
    </port>
    <port name="indexOut">
      <type>System.Int32</type>
      <description>The current position in the list.</description>
    </port>
    <port name="count">
      <type>System.Int32</type>
      <description>The number of elements in the list.</description>
    </port>
  </outPorts>
  <helpText>
    <p>
      This node can be used to take a specific element from an iterable object (array, list, etc.).
      The element is selected by navigating through the iterable object.
    </p>
    <p>
      The navigation can be done relatively by foreward or backward navigation or
      absolutely by providing an absolute index for the required item.
    </p>
    <info>
      The performance of this node is significantly better, if the processed
      enumerations additionally implement the interface <c>System.Collections.IList</c>.
      Otherwise a new list is created for every processed enumeration
      and the content of the enumeration is copied to the list,
      which can be a significant overhead for large enumerations.
      If you only need to iterate sequentially foreward through an enumeration,
      the node type <a href="DynamicNode.Lib.Basic.Iteration.xml">Basics : Iteration</a>
      is the better choice. Because it does not need random access to the elements of the
      enumerable objects.
    </info>
  </helpText>
</node>