示例#1
0
 public override bool Equals(object obj)
 {
     ClientUtils.WeakRefCollection refs = obj as ClientUtils.WeakRefCollection;
     if (refs != this)
     {
         if ((refs == null) || (this.Count != refs.Count))
         {
             return(false);
         }
         for (int i = 0; i < this.Count; i++)
         {
             if ((this.InnerList[i] != refs.InnerList[i]) && ((this.InnerList[i] == null) || !this.InnerList[i].Equals(refs.InnerList[i])))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
示例#2
0
 private static void Copy(ClientUtils.WeakRefCollection sourceList, int sourceIndex, ClientUtils.WeakRefCollection destinationList, int destinationIndex, int length)
 {
     if (sourceIndex < destinationIndex)
     {
         sourceIndex      += length;
         destinationIndex += length;
         while (length > 0)
         {
             destinationList.InnerList[--destinationIndex] = sourceList.InnerList[--sourceIndex];
             length--;
         }
     }
     else
     {
         while (length > 0)
         {
             destinationList.InnerList[destinationIndex++] = sourceList.InnerList[sourceIndex++];
             length--;
         }
     }
 }