CorrelationProperty 類別



The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*

代表用於將訊息與特定接收活動建立相互關聯的名稱/值組。Represents a name and value pair used to correlate messages to specific receiving activities.

public ref class CorrelationProperty
public class CorrelationProperty
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public class CorrelationProperty
type CorrelationProperty = class
[<System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>]
type CorrelationProperty = class
Public Class CorrelationProperty


下列範例將示範建立相互關聯屬性物件與存取 Name 和 Value 屬性。The following example demonstrates creating a correlation property object, and accessing the Name and Value properties.

// Create a new Correlation Property object
CorrelationProperty correlationProperty = new CorrelationProperty("taskName", "reportBalance");
// Read the property name
String taskName = correlationProperty.Name;
// Read the property value
Object taskValue = correlationProperty.Value;
' Create a new Correlation Property object
Dim correlationProperty As New CorrelationProperty("taskName", "reportBalance")
' Read the property name
Dim taskName As String = correlationProperty.Name
' Read the property value
Dim taskValue As Object = correlationProperty.Value



此資料討論已被汰換的類型及命名空間。This material discusses types and namespaces that are obsolete. 如需詳細資訊,請參閱 Windows Workflow Foundation 4.5 中即將淘汰的類型For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

CorrelationProperty 類別定義為工作流程連線服務活動的 ActivityBind 屬性。CorrelationProperty classes are defined as ActivityBind properties of Workflow Connection Service activities. 根據預設,這些屬性繫結到在根工作流程活動宣告的變數。By default, these properties are bound to variables declared at the root workflow activity. 至於 ReplicatorActivityConditionedActivityGroup 等動態活動,活動中的每個子系都不能共用通用的 CorrelationProperty 物件。For dynamic activities such as ReplicatorActivity and ConditionedActivityGroup each of its children cannot share a universal CorrelationProperty object. 請考量在 ReplicatorActivity 中的每個工作必須管理自己的交談的情況。Consider the scenario where each task inside a ReplicatorActivity has to manage its own conversation. ReplicatorActivity 內的子活動需要依照執行內容或工作的唯一 CorrelationProperty 執行個體。The child activities inside the ReplicatorActivity requires a CorrelationProperty instance unique per execution context, or per task. 為了達到這個目的,您必須定義有 CorrelationProperty 執行個體屬性的自訂活動,而且工作流程連線服務活動必須繫結到此屬性。In order to accomplish this, you have to define a custom activity that has a CorrelationProperty instance property and the Workflow Connection Services activities have to bind to this property.


CorrelationProperty(String, Object)

初始化 CorrelationProperty 類別的新執行個體。Initializes a new instance of the CorrelationProperty class.



取得在相互關聯集中使用的屬性名稱。Gets the name of the property used in the correlation set.


取得相互關聯集屬性的值。Gets the value of the correlation set property.



判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)