Redigera

Dela via


SendActivity.GetContext Method

Definition

Returns a dictionary that contains the context used for communication between the client and the service it is communicating with, including such things as identification for correlation.

Overloads

GetContext(Activity, ChannelToken, Type)

Gets or sets the context information for a send operation.

GetContext(Activity, String, String, Type)

Static method that returns context information given an activity instance, an endpoint name used by that activity, the name of the owner activity, and a Type object that represents the type of the contract.

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.

GetContext(Activity, ChannelToken, Type)

Gets or sets the context information for a send operation.

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

Parameters

activity
Activity

Activity whose context information is required.

endpoint
ChannelToken

Endpoint information for correlation with a service.

contractType
Type

The Type of the contract implemented by a service.

Returns

A dictionary-based collection that contains XmlQualifiedName keys and their associated String values.

Examples

The following example shows how to use the GetContext method.

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

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

GetContext(Activity, String, String, Type)

Static method that returns context information given an activity instance, an endpoint name used by that activity, the name of the owner activity, and a Type object that represents the type of the contract.

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

Parameters

activity
Activity

Activity whose context information is required.

endpointName
String

Name of the 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.

Returns

A dictionary-based collection that contains XmlQualifiedName keys and their associated String values.

Examples

The following example shows how to use the GetContext method.

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

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