Ejemplo n.º 1
0
    // ************************************************************************
    // Public Methods
    // ************************************************************************
    #region Public Methods

    /// <summary>
    /// Constructor for when a node is added to the end of the list.
    /// </summary>
    /// <param name="previous"></param>
    /// <param name="index"></param>
    public DoubleLinkListIndexNode(DoubleLinkListIndexNode previous, int index) {
      Previous = previous;
      Next = null;
      Index = index;
      if (Previous != null) {
        Previous.Next = this;
      }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor for when a node is inserted into the middle of the list.
 /// </summary>
 /// <param name="previous"></param>
 /// <param name="index"></param>
 public DoubleLinkListIndexNode(DoubleLinkListIndexNode previous, DoubleLinkListIndexNode next) {
   Previous = previous;
   Next = next;
   Index = next.Index;
   if (Previous != null) {
     Previous.Next = this;
   }
   if (Next != null) {
     Next.Previous = this;
     IncrementForward();
   }
 }