ActivityTrackPoint.MatchingLocations 属性

定义

获取运行时跟踪基础结构应包括在跟踪点匹配中的位置的集合。

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,则将匹配跟踪点。

适用于