Example #1
0
        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);
        }
Example #3
0
        public IEnumerable <DailyListElement> GetAllNodes()
        {
            DailyListElement        current = head;
            List <DailyListElement> lst     = new List <DailyListElement>();

            while (current != null)
            {
                lst.Add(current);
                current = current.next;
            }
            return(lst);
        }
Example #4
0
 public void Add(DailyListElement newItem)
 {
     if (current != null)
     {
         current.next = newItem;
     }
     current = newItem;
     if (head == null)
     {
         head = current;
     }
 }