ActivityTrackPoint.MatchingLocations 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得應由執行階段追蹤基礎結構包含在追蹤點比對內的位置集合。
public:
property System::Workflow::Runtime::Tracking::ActivityTrackingLocationCollection ^ MatchingLocations { System::Workflow::Runtime::Tracking::ActivityTrackingLocationCollection ^ get(); };
public System.Workflow.Runtime.Tracking.ActivityTrackingLocationCollection MatchingLocations { get; }
member this.MatchingLocations : System.Workflow.Runtime.Tracking.ActivityTrackingLocationCollection
Public ReadOnly Property MatchingLocations As ActivityTrackingLocationCollection
屬性值
ActivityTrackingLocationCollection,指定要為追蹤點比對的位置。 預設為空集合。
範例
下列範例示範存取 MatchingLocations 屬性。 這個範例來自<TrackingProfileDesigner SDK>範例。 如需詳細資訊,請參閱 追蹤配置文件設計工具範例。
/// <summary>
/// Saves a tracking condition for an activity
/// </summary>
/// <param name="activity"></param>
/// <param name="key"></param>
/// <param name="member"></param>
/// <param name="op"></param>
/// <param name="value"></param>
internal void SaveTrackingCondition(Activity activity, ref ActivityTrackingCondition key, string member, ComparisonOperator op, string value)
{
ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity);
if (trackPoint != null)
{
if (key == null)
{
key = new ActivityTrackingCondition();
trackPoint.MatchingLocations[0].Conditions.Add(key);
}
key.Member = member;
key.Value = value;
key.Operator = op;
}
}
' Saves a tracking condition for an activity
' <param name="activity"></param>
' <param name="key"></param>
' <param name="member"></param>
' <param name="op"></param>
' <param name="value"></param>
Friend Sub SaveTrackingCondition(ByVal activity As Activity, ByRef key As ActivityTrackingCondition, ByVal member As String, ByVal op As ComparisonOperator, ByVal value As String)
Dim trackPoint As ActivityTrackPoint = GetTrackPointForActivity(activity)
If trackPoint IsNot Nothing Then
If (key Is Nothing) Then
key = New ActivityTrackingCondition()
trackPoint.MatchingLocations(0).Conditions.Add(key)
End If
key.Member = member
key.Value = value
key.Operator = op
End If
End Sub
備註
如果 MatchingLocations 是空白,執行階段追蹤基礎結構就無法比對追蹤點。 您必須加入至少一個 ActivityTrackingLocation 至 MatchingLocations 的 ActivityTrackPoint 才可以參與比對。
如果 ActivityTrackingLocation 中的任何 MatchingLocations 由執行階段追蹤基礎結構比對相符,且 ActivityTrackingLocation 中的所有 ExcludedLocations 都不相符,將會比對追蹤點。