예제 #1
0
 public IEnumerator <T> GetEnumerator()
 {
     foreach (var node in FuncEnumerable <WeakNode> .Get(GetNodeEnumerator))
     {
         T current;
         if (node.TryGetValue(out current))
         {
             yield return(current);
         }
     }
 }
예제 #2
0
        public void Add(T item)
        {
            Contract.Requires <ArgumentNullException>(item != null);

            var node = new WeakNode(item);

            var last = FuncEnumerable <WeakNode> .Get(GetNodeEnumerator).LastOrDefault();

            if (last == null)
            {
                m_head = node;
            }
            else
            {
                last.Next = node;
            }
        }