CorrelationHandle 類別

定義

藉由代表特定的共用 InstanceKey 或工作流程中的暫時性內容,在同一個相互關聯中產生活動的關聯。

public ref class CorrelationHandle : System::Activities::Handle
[System.Runtime.Serialization.DataContract]
public class CorrelationHandle : System.Activities.Handle
[<System.Runtime.Serialization.DataContract>]
type CorrelationHandle = class
    inherit Handle
Public Class CorrelationHandle
Inherits Handle
繼承
CorrelationHandle
屬性

範例

下列範例將示範如何在 CorrelationHandle 活動上設定 SendReply

new SendReply
{
    DisplayName = "Send Adjusted Cost",
    Request = prescriptionRequest,
    // Initialize the orderHandle using the MessageQuerySet to correlate with the final GetAdjustedCost request
    CorrelationInitializers = 
    {
        new QueryCorrelationInitializer
        {
            CorrelationHandle = orderHandle,
            MessageQuerySet = GetOrderQuerySet
        }
    },
    Content = SendContent.Create(new InArgument<Order>((e) => order.Get(e)))
}

備註

Windows Workflow Foundation (WF) 提供四種類型的相互關聯: 內容型要求-回復長期雙工內容交換。 如需相互關聯的詳細資訊,請參閱 相互關聯概觀、先前提及的特定相互關聯類型,以及 LINQ 訊息查詢相互關聯 範例。

如果存在,執行時間會使用 CorrelationHandle 進行相互關聯,否則會使用傳訊活動的 CorrelatesWith 屬性。 如果都沒有,則會使用 CorrelationScope 所提供的環境控制代碼或工作流程服務。

建構函式

CorrelationHandle()

初始化 CorrelationHandle 類別的新執行個體。

屬性

ExecutionPropertyName

在新增至活動的執行屬性時,取得這個 Handle 要使用的名稱。

(繼承來源 Handle)
Owner

取得包含 ActivityInstance (其中包括 Variable) 的 Handle

(繼承來源 Handle)

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
OnInitialize(HandleInitializationContext)

向工作流程執行階段註冊 CorrelationHandle

OnUninitialize(HandleInitializationContext)

向工作流程執行階段取消註冊 CorrelationHandle

ThrowIfUninitialized()

如果 InvalidOperationException 尚未初始化,會擲回 Handle

(繼承來源 Handle)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於