Ejemplo n.º 1
0
 internal Enumerator(NCLinkedList <T> list)
 {
     this.list    = list;
     this.node    = list.head;
     this.current = default(T);
     this.index   = 0;
     this.siInfo  = null;
 }
Ejemplo n.º 2
0
 internal Enumerator(SerializationInfo info, StreamingContext context)
 {
     this.siInfo = info;
     this.list   = null;
     //this.version = 0;
     this.node    = null;
     this.current = default(T);
     this.index   = 0;
 }
Ejemplo n.º 3
0
        public NCLinkedList <T> Clone()
        {
            IEnumerator      _enum = this.GetEnumerator();
            NCLinkedList <T> list  = new NCLinkedList <T>();

            while (_enum.MoveNext())
            {
                list.AddLast((T)_enum.Current);
            }

            return(list);
        }
Ejemplo n.º 4
0
        public void AppendLinkedList(NCLinkedList <T> secondList)
        {
            if (this.head == null)
            {
                this.head  = secondList.head;
                this.count = this.count + secondList.count;
            }
            else
            {
                secondList.head.prev.next = this.head;
                this.head.prev.next       = secondList.head;

                this.head.prev = secondList.head.prev;
                this.count     = this.count + secondList.count;
            }
        }
Ejemplo n.º 5
0
 void IDeserializationCallback.OnDeserialization(object sender)
 {
     if (this.list == null)
     {
         if (this.siInfo == null)
         {
             throw new SerializationException("Serialization invalid on deserialize");
         }
         this.list    = (NCLinkedList <T>) this.siInfo.GetValue("LinkedList", typeof(NCLinkedList <T>));
         this.current = (T)this.siInfo.GetValue("Current", typeof(T));
         this.index   = this.siInfo.GetInt32("Index");
         if (this.list.siInfo != null)
         {
             this.list.OnDeserialization(sender);
         }
         if (this.index == (this.list.Count + 1))
         {
             this.node = null;
         }
         else
         {
             this.node = this.list.First;
             if ((this.node != null) && (this.index != 0))
             {
                 for (int i = 0; i < this.index; i++)
                 {
                     this.node = this.node.next;
                 }
                 if (this.node == this.list.First)
                 {
                     this.node = null;
                 }
             }
         }
         this.siInfo = null;
     }
 }
Ejemplo n.º 6
0
 internal NCLinkedListNode(NCLinkedList <T> list, T value)
 {
     this.item = value;
 }