Exemple #1
0
 public Enumerator(SegmentedList <T> source)
 {
     this.enumerator = source.GetEnumerator();
 }
        public SynchronizedEnumerator <T> GetEnumerator()
        {
            List <T> source = this.source as List <T>;

            if (source != null)
            {
                return(new SynchronizedEnumerator <T, List <T> .Enumerator>(this.sync, source.GetEnumerator()));
            }
            SegmentedList <T> list2 = this.source as SegmentedList <T>;

            if (list2 != null)
            {
                return(new SynchronizedEnumerator <T, SegmentedList <T> .Enumerator>(this.sync, list2.GetEnumerator()));
            }
            SparseList <T> list3 = this.source as SparseList <T>;

            if (list3 != null)
            {
                return(new SynchronizedEnumerator <T, SparseList <T> .Enumerator>(this.sync, list3.GetEnumerator()));
            }
            return(new SynchronizedEnumerator <T, IEnumerator <T> >(this.sync, this.source.GetEnumerator()));
        }