Click or drag to resize
BagTCloneContents Method
Makes a deep clone of this bag. A new bag is created with a clone of each element of this bag, by calling ICloneable.Clone on each element. If T is a value type, then each element is copied as if by simple assignment.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public Bag<T> CloneContents()

Return Value

Type: BagT
The cloned bag.
Exceptions
ExceptionCondition
InvalidOperationExceptionT is a reference type that does not implement ICloneable.
Remarks

If T is a reference type, it must implement ICloneable. Otherwise, an InvalidOperationException is thrown.

Cloning the bag takes time O(N log N), where N is the number of items in the bag.

See Also