A Sandcastle Documented Class Library

# ICallerContextService CloneAndSetCurrentContextIfRequired Method

Ensures that the properties of the specified context are associated with the current thread.

Namespace: Dundas.BI
Assembly: Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (10.0.0.1002)
Syntax
C#
VB
C++
F#
Copy

    CallerContext CloneAndSetCurrentContextIfRequired(
    	CallerContext context
    )

    Function CloneAndSetCurrentContextIfRequired (
    	context As CallerContext
    ) As CallerContext

    CallerContext^ CloneAndSetCurrentContextIfRequired(
    	CallerContext^ context
    )

    abstract CloneAndSetCurrentContextIfRequired :
            context : CallerContext -> CallerContext

#### Parameters

context
  Type: Dundas.BI
  CallerContext
  The context object which needs to be associated with the current thread.

#### Return Value

Type: CallerContext
If it was necessary to create a new context, the context; otherwise,
.
Exceptions

Exception | Condition
--- | ---
ArgumentNullException | context is .

Remarks
Use this method in multi-threading scenarios where you need the properties of a specific context to be associated with a different thread. If called on the same thread, nothing will happen and the method will return
. If called on a different thread, the provided context will be cloned, and the clone will be associated with that thread.
See Also

#### Reference

ICallerContextService Interface
Dundas.BI Namespace