public IEnumerable <Notebook> BackEnumerator() { DoubleNode <Notebook> current = Tail; while (current != null) { yield return(current.Element); current = current.PrevElement; } }
IEnumerator <Notebook> IEnumerable <Notebook> .GetEnumerator() { DoubleNode <Notebook> current = Head; while (current != null) { yield return(current.Element); current = current.NextElement; } }
public bool MoveNext() { DoubleNode <Notebook> current = (DoubleNode <Notebook>)Head; while (current != null) { if (current.Element.Equals(current.Element)) { return(true); } current = current.NextElement; } return(false); }
//=> throw new NotImplementedException(); public void Add(Notebook value) { DoubleNode <Notebook> node = new DoubleNode <Notebook>(value); if (Head == null) { Head = node; } else { Tail.NextElement = node; } Tail = node; //throw new NotImplementedException(); }
public Notebook this[int index] { get { DoubleNode <Notebook> currentNode = Head; int i = 0; while (currentNode != null && i != index) { currentNode = currentNode.NextElement; i++; } return(currentNode.Element); } }