EventTrackingEnabledAttribute Klasa
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
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
- Atrybuty
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
Aby uzyskać więcej informacji na temat używania atrybutów, zobacz Atrybuty.
Event |
Inicjuje EventTrackingEnabledAttribute nowe wystąpienie klasy, włączając śledzenie zdarzeń. |
Event |
Inicjuje EventTrackingEnabledAttribute nowe wystąpienie klasy, opcjonalnie wyłączając śledzenie zdarzeń. |
Type |
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. |
Equals(Object) |
Zwraca wartość wskazującą, czy to wystąpienie jest równe podanemu obiektowi. (Odziedziczone po Attribute) |
Get |
Zwraca wartość skrótu dla tego wystąpienia. (Odziedziczone po Attribute) |
Get |
Type Pobiera wartość bieżącego wystąpienia. (Odziedziczone po Object) |
Is |
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) |
Memberwise |
Tworzy płytkią kopię bieżącego Objectelementu . (Odziedziczone po Object) |
To |
Zwraca ciąg reprezentujący bieżący obiekt. (Odziedziczone po Object) |
_Attribute. |
Zestaw nazw jest mapowany na odpowiedni zestaw identyfikatorów wysyłania. (Odziedziczone po Attribute) |
_Attribute. |
Pobiera informacje o typie dla obiektu, który może służyć do pobierania informacji o typie dla interfejsu. (Odziedziczone po Attribute) |
_Attribute. |
Pobiera informację o liczbie typów interfejsów, jakie zawiera obiekt (0 lub 1). (Odziedziczone po Attribute) |
_Attribute. |
Umożliwia dostęp do właściwości i metod udostępnianych przez obiekt. (Odziedziczone po Attribute) |
Produkt | Wersje |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Opinia o produkcie .NET
.NET to projekt typu open source. Wybierz link, aby przekazać opinię: