EventTrackingEnabledAttribute Klasa

Definicja

Włącza śledzenie zdarzeń dla składnika. Klasa ta nie może być dziedziczona.

public ref class EventTrackingEnabledAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)]
[System.Runtime.InteropServices.ComVisible(false)]
public sealed class EventTrackingEnabledAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)>]
[<System.Runtime.InteropServices.ComVisible(false)>]
type EventTrackingEnabledAttribute = class
    inherit Attribute
Public NotInheritable Class EventTrackingEnabledAttribute
Inherits Attribute
Dziedziczenie
EventTrackingEnabledAttribute
Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano użycie EventTrackingEnabledAttribute typu .

using System;
using System.EnterpriseServices;
using System.Reflection;

// References:
// System.EnterpriseServices

[EventTrackingEnabled]
public class EventTrackingEnabledAttribute_Ctor : ServicedComponent
{
}

[EventTrackingEnabled(false)]
public class EventTrackingEnabledAttribute_Ctor_Bool : ServicedComponent
{
}

[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);
    }
}
Imports System.EnterpriseServices
Imports System.Reflection


' References:
' System.EnterpriseServices

<EventTrackingEnabled()>  _
Public Class EventTrackingEnabledAttribute_Ctor
    Inherits ServicedComponent
End Class

<EventTrackingEnabled(False)>  _
Public Class EventTrackingEnabledAttribute_Ctor_Bool
    Inherits ServicedComponent
End Class

<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

Uwagi

Aby uzyskać więcej informacji na temat używania atrybutów, zobacz Atrybuty.

Konstruktory

EventTrackingEnabledAttribute()

Inicjuje EventTrackingEnabledAttribute nowe wystąpienie klasy, włączając śledzenie zdarzeń.

EventTrackingEnabledAttribute(Boolean)

Inicjuje EventTrackingEnabledAttribute nowe wystąpienie klasy, opcjonalnie wyłączając śledzenie zdarzeń.

Właściwości

TypeId

Po zaimplementowaniu w klasie pochodnej pobiera unikatowy identyfikator dla tego Attributeelementu .

(Odziedziczone po Attribute)
Value

Pobiera wartość Value właściwości, która wskazuje, czy śledzenie jest włączone.

Metody

Equals(Object)

Zwraca wartość wskazującą, czy to wystąpienie jest równe podanemu obiektowi.

(Odziedziczone po Attribute)
GetHashCode()

Zwraca wartość skrótu dla tego wystąpienia.

(Odziedziczone po Attribute)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
IsDefaultAttribute()

Podczas zastępowania w klasie pochodnej wskazuje, czy wartość tego wystąpienia jest wartością domyślną dla klasy pochodnej.

(Odziedziczone po Attribute)
Match(Object)

Po przesłonięciu w klasie pochodnej zwraca wartość wskazującą, czy to wystąpienie jest równe określonemu obiektowi.

(Odziedziczone po Attribute)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Jawne implementacje interfejsu

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Zestaw nazw jest mapowany na odpowiedni zestaw identyfikatorów wysyłania.

(Odziedziczone po Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Pobiera informacje o typie dla obiektu, który może służyć do pobierania informacji o typie dla interfejsu.

(Odziedziczone po Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Pobiera informację o liczbie typów interfejsów, jakie zawiera obiekt (0 lub 1).

(Odziedziczone po Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Umożliwia dostęp do właściwości i metod udostępnianych przez obiekt.

(Odziedziczone po Attribute)

Dotyczy