Compartir por


EventSource.Write Método

Definición

Escribe un evento.

Sobrecargas

Nombre Description
Write(String)

Escribe un evento sin campos, pero con el nombre especificado y las opciones predeterminadas.

Write(String, EventSourceOptions)

Escribe un evento sin campos, pero con el nombre y las opciones especificados.

Write<T>(String, EventSourceOptions, Guid, Guid, T)

Escribe un evento con el nombre, las opciones, la actividad relacionada y los datos de eventos especificados.

Write<T>(String, T)

Escribe un evento con el nombre y los datos especificados.

Write<T>(String, EventSourceOptions, T)

Escribe un evento con el nombre, los datos de eventos y las opciones especificados.

Write<T>(String, EventSourceOptions, T)

Escribe un evento con el nombre, las opciones y los datos de eventos especificados.

Write(String)

Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs

Escribe un evento sin campos, pero con el nombre especificado y las opciones predeterminadas.

public:
 void Write(System::String ^ eventName);
public void Write(string eventName);
public void Write(string? eventName);
member this.Write : string -> unit
Public Sub Write (eventName As String)

Parámetros

eventName
String

Nombre del evento que se va a escribir.

Excepciones

eventName es null.

Se aplica a

Write(String, EventSourceOptions)

Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs

Escribe un evento sin campos, pero con el nombre y las opciones especificados.

public:
 void Write(System::String ^ eventName, System::Diagnostics::Tracing::EventSourceOptions options);
public void Write(string eventName, System.Diagnostics.Tracing.EventSourceOptions options);
public void Write(string? eventName, System.Diagnostics.Tracing.EventSourceOptions options);
member this.Write : string * System.Diagnostics.Tracing.EventSourceOptions -> unit
Public Sub Write (eventName As String, options As EventSourceOptions)

Parámetros

eventName
String

Nombre del evento que se va a escribir.

options
EventSourceOptions

Opciones como el nivel, las palabras clave y el código de operación para el evento.

Excepciones

eventName es null.

Se aplica a

Write<T>(String, EventSourceOptions, Guid, Guid, T)

Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs

Escribe un evento con el nombre, las opciones, la actividad relacionada y los datos de eventos especificados.

public:
generic <typename T>
 void Write(System::String ^ eventName, System::Diagnostics::Tracing::EventSourceOptions % options, Guid % activityId, Guid % relatedActivityId, T % data);
public void Write<T>(string eventName, ref System.Diagnostics.Tracing.EventSourceOptions options, ref Guid activityId, ref Guid relatedActivityId, ref T data);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
public void Write<T>(string? eventName, ref System.Diagnostics.Tracing.EventSourceOptions options, ref Guid activityId, ref Guid relatedActivityId, ref T data);
public void Write<T>(string? eventName, ref System.Diagnostics.Tracing.EventSourceOptions options, ref Guid activityId, ref Guid relatedActivityId, ref T data);
member this.Write : string * EventSourceOptions * Guid * Guid * 'T -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")>]
member this.Write : string * EventSourceOptions * Guid * Guid * 'T -> unit
Public Sub Write(Of T) (eventName As String, ByRef options As EventSourceOptions, ByRef activityId As Guid, ByRef relatedActivityId As Guid, ByRef data As T)

Parámetros de tipo

T

Tipo que define el evento y sus datos asociados. Este tipo debe ser un tipo anónimo o marcado con el EventSourceAttribute atributo .

Parámetros

eventName
String

Nombre del evento.

options
EventSourceOptions

Las opciones del evento.

activityId
Guid

Identificador de la actividad asociada al evento.

relatedActivityId
Guid

Identificador de una actividad asociada o Empty si no hay ninguna actividad asociada.

data
T

Los datos del evento. Este tipo debe ser un tipo anónimo o marcado con el EventDataAttribute atributo .

Atributos

Comentarios

Si eventName es null, el nombre del evento se deriva automáticamente de los datos de eventos de tipo T (Name) o se determina en función del nombre del tipo T. Las propiedades de instancia pública de data se escribirán de forma recursiva para crear los campos de evento.

Se aplica a

Write<T>(String, T)

Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs

Escribe un evento con el nombre y los datos especificados.

public:
generic <typename T>
 void Write(System::String ^ eventName, T data);
public void Write<T>(string eventName, T data);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
public void Write<T>(string? eventName, T data);
public void Write<T>(string? eventName, T data);
member this.Write : string * 'T -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")>]
member this.Write : string * 'T -> unit
Public Sub Write(Of T) (eventName As String, data As T)

Parámetros de tipo

T

Tipo que define el evento y sus datos asociados. Este tipo debe ser un tipo anónimo o marcado con el EventSourceAttribute atributo .

Parámetros

eventName
String

Nombre del evento.

data
T

Los datos del evento. Este tipo debe ser un tipo anónimo o marcado con el EventDataAttribute atributo .

Atributos

Comentarios

Si eventName es null, el nombre del evento se deriva automáticamente de los datos de eventos de tipo T (Name) o se determina en función del nombre del tipo T. Las propiedades de instancia pública de data se escribirán de forma recursiva para crear los campos de evento.

Se aplica a

Write<T>(String, EventSourceOptions, T)

Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs

Escribe un evento con el nombre, los datos de eventos y las opciones especificados.

public:
generic <typename T>
 void Write(System::String ^ eventName, System::Diagnostics::Tracing::EventSourceOptions options, T data);
public void Write<T>(string eventName, System.Diagnostics.Tracing.EventSourceOptions options, T data);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
public void Write<T>(string? eventName, System.Diagnostics.Tracing.EventSourceOptions options, T data);
public void Write<T>(string? eventName, System.Diagnostics.Tracing.EventSourceOptions options, T data);
member this.Write : string * System.Diagnostics.Tracing.EventSourceOptions * 'T -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")>]
member this.Write : string * System.Diagnostics.Tracing.EventSourceOptions * 'T -> unit
Public Sub Write(Of T) (eventName As String, options As EventSourceOptions, data As T)

Parámetros de tipo

T

Tipo que define el evento y sus datos asociados. Este tipo debe ser un tipo anónimo o marcado con el EventSourceAttribute atributo .

Parámetros

eventName
String

Nombre del evento.

options
EventSourceOptions

Las opciones del evento.

data
T

Los datos del evento. Este tipo debe ser un tipo anónimo o marcado con el EventDataAttribute atributo .

Atributos

Comentarios

Si eventName es null, el nombre del evento se deriva automáticamente de los datos de eventos de tipo T (Name) o se determina en función del nombre del tipo T. Las propiedades de instancia pública de data se escribirán de forma recursiva para crear los campos de evento.

Se aplica a

Write<T>(String, EventSourceOptions, T)

Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs
Source:
TraceLoggingEventSource.cs

Escribe un evento con el nombre, las opciones y los datos de eventos especificados.

public:
generic <typename T>
 void Write(System::String ^ eventName, System::Diagnostics::Tracing::EventSourceOptions % options, T % data);
public void Write<T>(string eventName, ref System.Diagnostics.Tracing.EventSourceOptions options, ref T data);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
public void Write<T>(string? eventName, ref System.Diagnostics.Tracing.EventSourceOptions options, ref T data);
public void Write<T>(string? eventName, ref System.Diagnostics.Tracing.EventSourceOptions options, ref T data);
member this.Write : string * EventSourceOptions * 'T -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")>]
member this.Write : string * EventSourceOptions * 'T -> unit
Public Sub Write(Of T) (eventName As String, ByRef options As EventSourceOptions, ByRef data As T)

Parámetros de tipo

T

Tipo que define el evento y sus datos asociados. Este tipo debe ser un tipo anónimo o marcado con el EventSourceAttribute atributo .

Parámetros

eventName
String

Nombre del evento.

options
EventSourceOptions

Las opciones del evento.

data
T

Los datos del evento. Este tipo debe ser un tipo anónimo o marcado con el EventDataAttribute atributo .

Atributos

Comentarios

Si eventName es null, el nombre del evento se deriva automáticamente de los datos de eventos de tipo T (Name) o se determina en función del nombre del tipo T. Las propiedades de instancia pública de data se escribirán de forma recursiva para crear los campos de evento.

Se aplica a