Click or drag to resize

CopyForAnotherThreadCopyT Method

Copies an object for use in another thread.

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public static T Copy<T>(
	T oldObject
)
where T : class

Parameters

oldObject
Type: T
The object to copy.

Type Parameters

T
The type of the object to copy.

Return Value

Type: T
A copy of oldObject that can be used simultaneously with oldObject from two different threads.
Examples

The following example shows how to use this method to create a copy of an object that can be used simultaneously with the original from another thread:

C#
// An object that we need to copy for another thread. In this case, we are 
// copying an evaluator. 
AxesEvaluator axesEvaluator = GeometryTransformer.GetAxesTransformation(fromAxes, toAxes);

// Call the static Copy method.
AxesEvaluator copiedEvaluator = CopyForAnotherThread.Copy(axesEvaluator);
See Also