AODL.Utils.ContentMocker.CloneContentCollection C# (CSharp) Method

CloneContentCollection() public method

public CloneContentCollection ( ContentCollection contentCollection ) : ContentCollection
contentCollection ContentCollection
return ContentCollection
		public ContentCollection CloneContentCollection(ContentCollection contentCollection)
		{
			ContentCollection clonedContent = new ContentCollection();
			
			int index = 0;
			foreach (IContent content in contentCollection)
			{
				index ++;
				try
				{
					clonedContent.Add(CloneAny(content));
				}
				catch (ContentMockerException e)
				{
					throw new ContentMockerException(string.Format(
						"Could not clone element {0} in given collection. Item " +
						" index was {1}",
						content.Node.Value,
						index), e);
				}
			}
			return clonedContent;
		}