Επεξεργασία

Κοινή χρήση μέσω


SendActivity.SetContext Method

Definition

Sets context information for a SendActivity activity.

Overloads

SetContext(Activity, ChannelToken, Type, IDictionary<String,String>)

A static method that sets context information for a SendActivity activity, given an activity instance, an endpoint used by that activity, a Type object that represents the type of the contract, and the context information itself.

SetContext(Activity, String, String, Type, IDictionary<String,String>)

A static method that sets context information for a SendActivity activity, given an activity instance, an endpoint name used by that activity, the name of the owner activity, a Type object that represents the type of the contract, and the context information itself.

Remarks

Context information is used for communication between the client and the service it is communicating and includes such things as identification for correlation.

SetContext(Activity, ChannelToken, Type, IDictionary<String,String>)

A static method that sets context information for a SendActivity activity, given an activity instance, an endpoint used by that activity, a Type object that represents the type of the contract, and the context information itself.

public:
 static void SetContext(System::Workflow::ComponentModel::Activity ^ activity, System::Workflow::Activities::ChannelToken ^ endpoint, Type ^ contractType, System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ context);
public static void SetContext (System.Workflow.ComponentModel.Activity activity, System.Workflow.Activities.ChannelToken endpoint, Type contractType, System.Collections.Generic.IDictionary<string,string> context);
static member SetContext : System.Workflow.ComponentModel.Activity * System.Workflow.Activities.ChannelToken * Type * System.Collections.Generic.IDictionary<string, string> -> unit
Public Shared Sub SetContext (activity As Activity, endpoint As ChannelToken, contractType As Type, context As IDictionary(Of String, String))

Parameters

activity
Activity

The Activity instance to associate the context information with.

endpoint
ChannelToken

The endpoint used for correlation with a service.

contractType
Type

The Type of the contract implemented by a service.

context
IDictionary<String,String>

The context information to set.

Examples

The following example shows how to use the SetContext method.

Remarks

Context information is used for communication between the client and the service it is communicating with and includes such things as identification for correlation.

Applies to

SetContext(Activity, String, String, Type, IDictionary<String,String>)

A static method that sets context information for a SendActivity activity, given an activity instance, an endpoint name used by that activity, the name of the owner activity, a Type object that represents the type of the contract, and the context information itself.

public:
 static void SetContext(System::Workflow::ComponentModel::Activity ^ activity, System::String ^ endpointName, System::String ^ ownerActivityName, Type ^ contractType, System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ context);
public static void SetContext (System.Workflow.ComponentModel.Activity activity, string endpointName, string ownerActivityName, Type contractType, System.Collections.Generic.IDictionary<string,string> context);
static member SetContext : System.Workflow.ComponentModel.Activity * string * string * Type * System.Collections.Generic.IDictionary<string, string> -> unit
Public Shared Sub SetContext (activity As Activity, endpointName As String, ownerActivityName As String, contractType As Type, context As IDictionary(Of String, String))

Parameters

activity
Activity

The Activity instance to associate the context information with.

endpointName
String

The name of an endpoint used for correlation with a service.

ownerActivityName
String

The name of the owning activity.

contractType
Type

The Type of the contract implemented by a service.

context
IDictionary<String,String>

The context information to set.

Examples

The following example shows how to use the SetContext method.

SendActivity sendActivity1 = new SendActivity();
Dictionary<string, string> Context = (Dictionary<string, string>)SendActivity.GetContext(sendActivity1, endpointName, ownerActivityName, contractType);

Applies to