/// <summary> /// Makes a shallow copy of the current ExposedManagerCollection. /// as the parent object. /// </summary> /// <returns>ExposedManagerCollection</returns> public ExposedManagerCollection Clone() { ExposedManagerCollection clonedGreyFoxContact = new ExposedManagerCollection(count); lock (this) { foreach (ExposedManager item in this) { clonedGreyFoxContact.Add(item); } } return(clonedGreyFoxContact); }
/// <summary> /// Makes a deep copy of the current ExposedManager. /// </summary> /// <param name="isolation">Placeholders are used to isolate the /// items in the ExposedManagerCollection from their children.</param> public ExposedManagerCollection Copy(bool isolated) { ExposedManagerCollection isolatedCollection = new ExposedManagerCollection(count); lock (this) { if (isolated) { for (int i = 0; i < count; i++) { isolatedCollection.Add(managers[i]); } } else { for (int i = 0; i < count; i++) { isolatedCollection.Add(managers[i]); } } } return(isolatedCollection); }