Share via


SendActivity.GetContext 方法

定義

傳回一個字典,內含用戶端與通訊的服務之間的通訊所使用文字,包括相互關聯識別。

多載

GetContext(Activity, ChannelToken, Type)

取得或設定傳送作業的內容資訊。

GetContext(Activity, String, String, Type)

靜態方法,此方法可傳回所提供的活動執行個體之內容資訊、該活動使用的端點名稱、擁有者活動的名稱和代表合約型別的 Type 物件。

備註

內容資訊,是用戶端及其所通訊的服務之間所使用的通訊,包括相互關聯的識別。

GetContext(Activity, ChannelToken, Type)

取得或設定傳送作業的內容資訊。

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)

參數

activity
Activity

活動,其內容資訊為必要項目。

endpoint
ChannelToken

與服務相互關聯的端點資訊。

contractType
Type

服務所實作的合約之 Type

傳回

以字典為基礎的集合,內含 XmlQualifiedName 關鍵字及其關聯的 String 值。

範例

下列範例會示範如何使用 GetContext 方法。

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

備註

內容資訊,是用戶端及其所通訊的服務之間所使用的通訊,包括相互關聯的識別。

適用於

GetContext(Activity, String, String, Type)

靜態方法,此方法可傳回所提供的活動執行個體之內容資訊、該活動使用的端點名稱、擁有者活動的名稱和代表合約型別的 Type 物件。

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)

參數

activity
Activity

活動,其內容資訊為必要項目。

endpointName
String

用來與服務相互關聯的端點名稱。

ownerActivityName
String

擁有活動的名稱。

contractType
Type

服務所實作的合約之 Type

傳回

以字典為基礎的集合,內含 XmlQualifiedName 關鍵字及其關聯的 String 值。

範例

下列範例會示範如何使用 GetContext 方法。

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

備註

內容資訊,是用戶端及其所通訊的服務之間所使用的通訊,包括相互關聯的識別。

適用於