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--; } return; } while (length > 0) { destinationList.InnerList[destinationIndex++] = sourceList.InnerList[sourceIndex++]; length--; } }
public override bool Equals(object obj) { ClientUtils.WeakRefCollection weakRefCollection = obj as ClientUtils.WeakRefCollection; if (weakRefCollection == this) { return(true); } if (weakRefCollection == null || this.Count != weakRefCollection.Count) { return(false); } for (int i = 0; i < this.Count; i++) { if (this.InnerList[i] != weakRefCollection.InnerList[i] && (this.InnerList[i] == null || !this.InnerList[i].Equals(weakRefCollection.InnerList[i]))) { return(false); } } return(true); }