EventTrackingEnabledAttribute Třída
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Umožňuje sledování událostí pro komponentu. Tato třída se nemůže dědit.
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
- Dědičnost
- Atributy
Příklady
Následující příklad kódu ukazuje použití 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
Poznámky
Další informace o používání atributů naleznete v tématu Atributy.
Konstruktory
| Name | Description |
|---|---|
| EventTrackingEnabledAttribute() |
Inicializuje novou instanci EventTrackingEnabledAttribute třídy a povolí sledování událostí. |
| EventTrackingEnabledAttribute(Boolean) |
Inicializuje novou instanci EventTrackingEnabledAttribute třídy, volitelně zakázání sledování událostí. |
Vlastnosti
| Name | Description |
|---|---|
| TypeId |
Při implementaci v odvozené třídě získá jedinečný identifikátor pro tento Attribute. (Zděděno od Attribute) |
| Value |
Získá hodnotu Value vlastnosti, která označuje, zda sledování je povoleno. |
Metody
| Name | Description |
|---|---|
| Equals(Object) |
Vrátí hodnotu, která určuje, zda je tato instance rovna zadanému objektu. (Zděděno od Attribute) |
| GetHashCode() |
Vrátí kód hash pro tuto instanci. (Zděděno od Attribute) |
| GetType() |
Získá Type aktuální instance. (Zděděno od Object) |
| IsDefaultAttribute() |
Při přepsání v odvozené třídě určuje, zda hodnota této instance je výchozí hodnotou pro odvozenou třídu. (Zděděno od Attribute) |
| Match(Object) |
Při přepsání v odvozené třídě vrátí hodnotu, která určuje, zda se tato instance rovná zadanému objektu. (Zděděno od Attribute) |
| MemberwiseClone() |
Vytvoří mělkou kopii aktuálního Object. (Zděděno od Object) |
| ToString() |
Vrátí řetězec, který představuje aktuální objekt. (Zděděno od Object) |
Explicitní implementace rozhraní
| Name | Description |
|---|---|
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mapuje sadu názvů na odpovídající sadu identifikátorů pro rozesílání. (Zděděno od Attribute) |
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
Načte informace o typu objektu, který lze použít k získání informací o typu pro rozhraní. (Zděděno od Attribute) |
| _Attribute.GetTypeInfoCount(UInt32) |
Získá počet rozhraní typu informací, které objekt poskytuje (0 nebo 1). (Zděděno od Attribute) |
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Poskytuje přístup k vlastnostem a metodám vystaveným objektem. (Zděděno od Attribute) |