C-DEngine 5.105

TheCommonUtils..::..ClonePublic<(Of <(<'T>)>)> Method

Create a shallow copy of an object.

Namespace:  nsCDEngine.BaseClasses
Assembly:  C-DEngine (in C-DEngine.dll)

Syntax


public static T ClonePublic<T>(
	T MyValue,
	bool ResetBase
)
where T : TheDataBase
Public Shared Function ClonePublic(Of T As TheDataBase) ( _
	MyValue As T, _
	ResetBase As Boolean _
) As T
public:
generic<typename T>
where T : TheDataBase
static T ClonePublic(
	T MyValue, 
	bool^ ResetBase
)

Type Parameters

T

Parameters

MyValue
Type: T
The object to clone.
ResetBase
Type: Boolean
Whether to generate a unique object key (cdeMID) and creation time (cdeCTIM).

Return Value

A shallow clone of the object. In case of error, the return value is null.

Remarks


This function uses .NET Reflection to create a shallow copy of a reference type. For C-DEngine storage classes (which means classes derived from TheDataBase) this function can optionally generate a unique object key and creation time by setting the ResetBase field to true.