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