Click or drag to resize

SpriteDatabaseCloneByXMLSerializingT Method

This is an inefficient, but simple function to clone a class. It works by serializing an item to a string, and then deserializing it into a class. The end result is that any value which is publically visible is duplicated, but it is a completely separate class from the original.

Namespace:  SpriteLibrary
Assembly:  SpriteLibrary (in SpriteLibrary.dll) Version: 1.0.0.6 (1.0.0.6)
Syntax
C#
public static T CloneByXMLSerializing<T>(
	T ObjectToClone
)

Parameters

ObjectToClone
Type: T
The actual object to clone

Type Parameters

T
The type of the item to clone

Return Value

Type: T
A duplicate of the original
See Also