EventTrackingEnabledAttribute Classe

Definizione

Consente di attivare la registrazione degli eventi per un componente. La classe non può essere ereditata.

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
Ereditarietà
EventTrackingEnabledAttribute
Attributi

Esempio

Nell'esempio di codice seguente viene illustrato l'uso del EventTrackingEnabledAttribute tipo .

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

Commenti

Per altre informazioni sull'uso degli attributi, vedere Attributi.

Costruttori

EventTrackingEnabledAttribute()

Consente di inizializzare una nuova istanza della classe EventTrackingEnabledAttribute, attivando la registrazione degli eventi.

EventTrackingEnabledAttribute(Boolean)

Consente di inizializzare una nuova istanza della classe EventTrackingEnabledAttribute, disattivando eventualmente la registrazione degli eventi.

Proprietà

TypeId

Quando è implementata in una classe derivata, ottiene un identificatore univoco della classe Attribute.

(Ereditato da Attribute)
Value

Ottiene il valore della proprietà Value, che indica se è attivata la registrazione degli eventi.

Metodi

Equals(Object)

Restituisce un valore che indica se questa istanza è uguale a un oggetto specificato.

(Ereditato da Attribute)
GetHashCode()

Restituisce il codice hash per l'istanza.

(Ereditato da Attribute)
GetType()

Ottiene l'oggetto Type dell'istanza corrente.

(Ereditato da Object)
IsDefaultAttribute()

In caso di override in una classe derivata, indica se il valore di questa istanza è il valore predefinito per la classe derivata.

(Ereditato da Attribute)
Match(Object)

Quando è sottoposto a override in una classe derivata, restituisce un valore che indica se questa istanza equivale a un oggetto specificato.

(Ereditato da Attribute)
MemberwiseClone()

Crea una copia superficiale dell'oggetto Object corrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Implementazioni dell'interfaccia esplicita

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

Esegue il mapping di un set di nomi a un set corrispondente di ID dispatch.

(Ereditato da Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Recupera le informazioni sul tipo relative a un oggetto, che possono essere usate per ottenere informazioni sul tipo relative a un'interfaccia.

(Ereditato da Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Recupera il numero delle interfacce di informazioni sul tipo fornite da un oggetto (0 o 1).

(Ereditato da Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fornisce l'accesso a proprietà e metodi esposti da un oggetto.

(Ereditato da Attribute)

Si applica a