EventTrackingEnabledAttribute.Value 属性
定义
public:
property bool Value { bool get(); };
public bool Value { get; }
member this.Value : bool
Public ReadOnly Property Value As Boolean
属性值
如果启用跟踪,则为 true;否则为 false。true if tracking is enabled; otherwise, false. 默认为 true。The default is true.
示例
下面的代码示例获取 EventTrackingEnabled 属性的属性的值 Value 。The following code example gets the value of an EventTrackingEnabled attribute's Value property.
[EventTrackingEnabled(false)]
public class EventTrackingEnabledAttribute_Value : ServicedComponent
{
public void ValueExample()
{
// Get the EventTrackingEnabledAttribute applied to the class.
EventTrackingEnabledAttribute attribute =
(EventTrackingEnabledAttribute)Attribute.GetCustomAttribute(
this.GetType(),
typeof(EventTrackingEnabledAttribute),
false);
// Display the value of the attribute's Value property.
Console.WriteLine("EventTrackingEnabledAttribute.Value: {0}",
attribute.Value);
}
}
<EventTrackingEnabled(False)> _
Public Class EventTrackingEnabledAttribute_Value
Inherits ServicedComponent
Public Sub ValueExample()
' Get the EventTrackingEnabledAttribute applied to the class.
Dim attribute As EventTrackingEnabledAttribute = CType(Attribute.GetCustomAttribute(Me.GetType(), GetType(EventTrackingEnabledAttribute), False), EventTrackingEnabledAttribute)
' Display the value of the attribute's Value property.
MsgBox("EventTrackingEnabledAttribute.Value: " & attribute.Value)
End Sub
End Class