public DailyListElement Add() { var newItem = new DailyListElement(); if (head != null) { head.next = newItem; } head = newItem; return(newItem); }
public DailyListElement Add() { var dailyListElement = new DailyListElement(); if (head != null) { head.next = dailyListElement; } head = dailyListElement; return(dailyListElement); }
public IEnumerable <DailyListElement> GetAllNodes() { DailyListElement current = head; List <DailyListElement> lst = new List <DailyListElement>(); while (current != null) { lst.Add(current); current = current.next; } return(lst); }
public void Add(DailyListElement newItem) { if (current != null) { current.next = newItem; } current = newItem; if (head == null) { head = current; } }