ActivityTrackingCondition.Member 属性

定义

获取或设置要与 Value 比较的活动成员的名称。

public:
 virtual property System::String ^ Member { System::String ^ get(); void set(System::String ^ value); };
public override string Member { get; set; }
member this.Member : string with get, set
Public Overrides Property Member As String

属性值

活动成员的点线名称。

例外

已对条件求值,并且 Member 为空引用(在 Visual Basic 中为 Nothing)。

已对条件求值,并且 Member 的格式不正确。

已对条件求值,并且 Member 未引用有效的活动成员。

示例

下面的代码示例演示如何访问 Member 属性。 此示例摘自“跟踪配置文件设计器”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

注解

您可以指定活动属性或字段、活动属性或字段的成员,或者指定实现 IEnumerable<T> 接口的活动属性或字段(或其中任何一个的成员)的单一元素。 例如,可以指定集合的单一元素。

如果使用 的 ActivityTrackingCondition无参数构造函数,则必须显式设置 Member

通过应用 Value 将指定活动成员的值与 Operator 进行比较。

适用于