Click or drag to resize
weroSoft AG, Software
RuntimeExtensionsCloneT Method (Object, CloneWorkingMode, IEnumerableType)
The documentation is integral part of the weroSoft product documentation. This part is intended to be used by developers only.
Clones an object by serialization.

Namespace:  WeroSoft.Runtime
Assembly:  WeroSoft.Core.Library (in WeroSoft.Core.Library.dll) Version: 3.0 Pre-Release
public static T Clone<T>(
	this Object sourceObject,
	CloneWorkingMode workingMode = CloneWorkingMode.DataContractSerializer,
	IEnumerable<Type> types = null


Type: SystemObject
Object which shall be cloned.
workingMode (Optional)
Type: WeroSoft.RuntimeCloneWorkingMode
Mode used for cloning. Default is CloneWorkingMode.DateContractSerializer.
types (Optional)
Type: System.Collections.GenericIEnumerableType
Collection of types used for DataContractSerializer if necessary.

Type Parameters

Type the cloned object shall be cast to.

Return Value

Type: T
Cloned object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
If you configure the method to use the data contract serializer you must ensure that the rules of WCF are used. Especially you must take care about circular references. Circular references needs the named property 'IsReference' to be set true in this case; otherwise a StackOverflowException will be occur.
See Also