ActivityTrackingCondition.Value 属性

定义

要与 Member 进行比较的值。

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

属性值

比较中使用的值。

示例

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

注解

Value

Member 的值进行比较,方法是应用 Operator

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

适用于