Condividi tramite


EventSource.Write Metodo

Definizione

Scrive un evento.

Overload

Nome Descrizione
Write(String)

Scrive un evento senza campi, ma con il nome e le opzioni predefinite specificati.

Write(String, EventSourceOptions)

Scrive un evento senza campi, ma con il nome e le opzioni specificati.

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

Scrive un evento con il nome, le opzioni, i dati relativi all'attività e agli eventi specificati.

Write<T>(String, T)

Scrive un evento con il nome e i dati specificati.

Write<T>(String, EventSourceOptions, T)

Scrive un evento con il nome, i dati e le opzioni dell'evento specificati.

Write<T>(String, EventSourceOptions, T)

Scrive un evento con il nome, le opzioni e i dati dell'evento specificati.

Write(String)

Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs

Scrive un evento senza campi, ma con il nome e le opzioni predefinite specificati.

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)

Parametri

eventName
String

Nome dell'evento da scrivere.

Eccezioni

eventName è null.

Si applica a

Write(String, EventSourceOptions)

Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs

Scrive un evento senza campi, ma con il nome e le opzioni specificati.

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)

Parametri

eventName
String

Nome dell'evento da scrivere.

options
EventSourceOptions

Opzioni come livello, parole chiave e codice dell'operazione per l'evento.

Eccezioni

eventName è null.

Si applica a

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

Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs

Scrive un evento con il nome, le opzioni, i dati relativi all'attività e agli eventi specificati.

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)

Parametri di tipo

T

Tipo che definisce l'evento e i relativi dati associati. Questo tipo deve essere un tipo anonimo o contrassegnato con l'attributo EventSourceAttribute .

Parametri

eventName
String

Nome dell'evento.

options
EventSourceOptions

Opzioni dell'evento.

activityId
Guid

ID dell'attività associata all'evento.

relatedActivityId
Guid

ID di un'attività associata o Empty se non è presente alcuna attività associata.

data
T

Dati dell'evento. Questo tipo deve essere un tipo anonimo o contrassegnato con l'attributo EventDataAttribute .

Attributi

Commenti

Se eventName è null, il nome dell'evento viene derivato automaticamente dai dati dell'evento del tipo T (Name) o determinato in base al nome di tipo T. Le proprietà dell'istanza pubblica di data verranno scritte in modo ricorsivo per creare i campi dell'evento.

Si applica a

Write<T>(String, T)

Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs

Scrive un evento con il nome e i dati specificati.

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)

Parametri di tipo

T

Tipo che definisce l'evento e i relativi dati associati. Questo tipo deve essere un tipo anonimo o contrassegnato con l'attributo EventSourceAttribute .

Parametri

eventName
String

Nome dell'evento.

data
T

Dati dell'evento. Questo tipo deve essere un tipo anonimo o contrassegnato con l'attributo EventDataAttribute .

Attributi

Commenti

Se eventName è null, il nome dell'evento viene derivato automaticamente dai dati dell'evento del tipo T (Name) o determinato in base al nome di tipo T. Le proprietà dell'istanza pubblica di data verranno scritte in modo ricorsivo per creare i campi dell'evento.

Si applica a

Write<T>(String, EventSourceOptions, T)

Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs

Scrive un evento con il nome, i dati e le opzioni dell'evento specificati.

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)

Parametri di tipo

T

Tipo che definisce l'evento e i relativi dati associati. Questo tipo deve essere un tipo anonimo o contrassegnato con l'attributo EventSourceAttribute .

Parametri

eventName
String

Nome dell'evento.

options
EventSourceOptions

Opzioni dell'evento.

data
T

Dati dell'evento. Questo tipo deve essere un tipo anonimo o contrassegnato con l'attributo EventDataAttribute .

Attributi

Commenti

Se eventName è null, il nome dell'evento viene derivato automaticamente dai dati dell'evento del tipo T (Name) o determinato in base al nome di tipo T. Le proprietà dell'istanza pubblica di data verranno scritte in modo ricorsivo per creare i campi dell'evento.

Si applica a

Write<T>(String, EventSourceOptions, T)

Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs
Origine:
TraceLoggingEventSource.cs

Scrive un evento con il nome, le opzioni e i dati dell'evento specificati.

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)

Parametri di tipo

T

Tipo che definisce l'evento e i relativi dati associati. Questo tipo deve essere un tipo anonimo o contrassegnato con l'attributo EventSourceAttribute .

Parametri

eventName
String

Nome dell'evento.

options
EventSourceOptions

Opzioni dell'evento.

data
T

Dati dell'evento. Questo tipo deve essere un tipo anonimo o contrassegnato con l'attributo EventDataAttribute .

Attributi

Commenti

Se eventName è null, il nome dell'evento viene derivato automaticamente dai dati dell'evento del tipo T (Name) o determinato in base al nome di tipo T. Le proprietà dell'istanza pubblica di data verranno scritte in modo ricorsivo per creare i campi dell'evento.

Si applica a