Click or drag to resize
weroSoft AG, Software
RuntimeExtensionsClone 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
Syntax
C#
public static Object Clone(
	this Object sourceObject,
	CloneWorkingMode workingMode = CloneWorkingMode.DataContractSerializer,
	IEnumerable<Type> types = null
)

Parameters

sourceObject
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.

Return Value

Type: Object
Cloned object or null if the input is null.

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).
Remarks
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