/// <summary> /// Adds the item to the end of the linked list. /// </summary> /// <param name="newItem"></param> internal void Add(PossibleSignature newItem) { if (Last != null) { AddAfter(Last, newItem); } else { First = newItem; Last = newItem; Count++; } }
internal void AddAfter(PossibleSignature existing, PossibleSignature newItem) { newItem.Next = existing.Next; newItem.Previous = existing; if (existing.Next != null) { existing.Next.Previous = newItem; } existing.Next = newItem; if (existing == Last) { Last = newItem; } Count++; }
internal void AddBefore(PossibleSignature existing, PossibleSignature newItem) { newItem.Next = existing; newItem.Previous = existing.Previous; if (existing.Previous != null) { existing.Previous.Next = newItem; } existing.Previous = newItem; if (existing == First) { First = newItem; } Count++; }
/// <summary> /// Removes any reference to this element from the linked list. /// </summary> internal void Remove(PossibleSignature existing) { if (First == existing) { First = existing.Next; } if (Last == existing) { Last = existing.Previous; } if (existing.Previous != null) { existing.Previous.Next = existing.Next; } if (existing.Next != null) { existing.Next.Previous = existing.Previous; } Count--; }