Edit

Share via


ReceiveActivity.GetContext Method

Definition

Returns a dictionary that contains the context information used for communication between a client and the workflow service.

Overloads

GetContext(Activity, ContextToken)

Static method that returns context information given an activity instance and context token.

GetContext(Activity, String, String)

Static method that returns context information given an activity instance and context token.

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, ContextToken)

Static method that returns context information given an activity instance and context token.

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

Parameters

activity
Activity

Activity instance that context information is requested for.

contextToken
ContextToken

The context token used by the activity.

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.

ReceiveActivity receiveActivity1 = new ReceiveActivity();
Dictionary<XmlQualifiedName, String> context = (Dictionary<XmlQualifiedName, String>)ReceiveActivity.GetContext(receiveActivity1, receiveActivity1.ContextToken);

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)

Static method that returns context information given an activity instance and context token.

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

Parameters

activity
Activity

Activity instance that context information is requested for.

contextName
String

Name of the context token used by the activity.

ownerActivityName
String

The name of the owning activity name.

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.

ReceiveActivity receiveActivity1 = new ReceiveActivity();
Dictionary<XmlQualifiedName, String> context =
    (Dictionary<XmlQualifiedName, String>)ReceiveActivity.GetContext(
    receiveActivity1,
    "ContextToken1",
    "ReceiveActivity1");

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