Share via


EventTrackingEnabledAttribute.Value プロパティ

定義

Value プロパティの、追跡を有効にするかどうかを示す値を取得します。

public:
 property bool Value { bool get(); };
public bool Value { get; }
member this.Value : bool
Public ReadOnly Property Value As Boolean

プロパティ値

追跡が有効な場合は true。それ以外の場合は false。 既定値は、true です。

次のコード例では、属性Valueの プロパティの値をEventTrackingEnabled取得します。

[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

適用対象