コード例 #1
0
        public IEnumerator GetEnumerator()
        {
            for (int i = this.m_Iterators.Count - 1; i >= 0; i--)
            {
                WeakReference reference = (WeakReference)this.m_Iterators[i];
                if (!reference.IsAlive)
                {
                    this.m_Iterators.RemoveAt(i);
                }
            }
            ForEachEnum   target     = new ForEachEnum(this);
            WeakReference reference2 = new WeakReference(target);

            target.WeakRef = reference2;
            this.m_Iterators.Add(reference2);
            return(target);
        }
コード例 #2
0
 private void AdjustEnumeratorsHelper(Node NewOrRemovedNode, ForEachEnum.AdjustIndexType Type)
 {
     for (int i = this.m_Iterators.Count - 1; i >= 0; i--)
     {
         WeakReference reference = (WeakReference)this.m_Iterators[i];
         if (reference.IsAlive)
         {
             ForEachEnum target = (ForEachEnum)reference.Target;
             if (target != null)
             {
                 target.Adjust(NewOrRemovedNode, Type);
             }
         }
         else
         {
             this.m_Iterators.RemoveAt(i);
         }
     }
 }
コード例 #3
0
 public void Clear()
 {
     this.m_KeyedNodesHash.Clear();
     this.m_ItemsList.Clear();
     for (int i = this.m_Iterators.Count - 1; i >= 0; i--)
     {
         WeakReference reference = (WeakReference)this.m_Iterators[i];
         if (reference.IsAlive)
         {
             ForEachEnum target = (ForEachEnum)reference.Target;
             if (target != null)
             {
                 target.AdjustOnListCleared();
             }
         }
         else
         {
             this.m_Iterators.RemoveAt(i);
         }
     }
 }
コード例 #4
0
 public IEnumerator GetEnumerator()
 {
     for (int i = this.m_Iterators.Count - 1; i >= 0; i--)
     {
         WeakReference reference = (WeakReference) this.m_Iterators[i];
         if (!reference.IsAlive)
         {
             this.m_Iterators.RemoveAt(i);
         }
     }
     ForEachEnum target = new ForEachEnum(this);
     WeakReference reference2 = new WeakReference(target);
     target.WeakRef = reference2;
     this.m_Iterators.Add(reference2);
     return target;
 }
コード例 #5
0
 private void AdjustEnumeratorsHelper(Node NewOrRemovedNode, ForEachEnum.AdjustIndexType Type)
 {
     for (int i = this.m_Iterators.Count - 1; i >= 0; i--)
     {
         WeakReference reference = (WeakReference) this.m_Iterators[i];
         if (reference.IsAlive)
         {
             ForEachEnum target = (ForEachEnum) reference.Target;
             if (target != null)
             {
                 target.Adjust(NewOrRemovedNode, Type);
             }
         }
         else
         {
             this.m_Iterators.RemoveAt(i);
         }
     }
 }