Condividi tramite


TelemetrySession.TryAddCommonProperty(String, Object) Metodo

Definizione

Tenta di aggiungere una singola chiave di proprietà e un valore comuni a tutti gli eventi per la sessione, ma non deve avere il prefisso Context. Le proprietà non vengono rese persistenti tra le sessioni. Per aggiungere più proprietà, vedere AddCommonPropertyRange(IDictionary<String,Object>)

public bool TryAddCommonProperty (string propertyName, object propertyValue);
member this.TryAddCommonProperty : string * obj -> bool
Public Function TryAddCommonProperty (propertyName As String, propertyValue As Object) As Boolean

Parametri

propertyName
String
propertyValue
Object

Restituisce

true se la coppia chiave/valore è stata aggiunta, false se la chiave esiste già.

Eccezioni

Generata quando le proprietà, la chiave o il valore sono Null

Generata quando la chiave o il valore della proprietà è Null

Si applica a