in src/Microsoft.VisualStudio.SlnGen/TelemetryClient.cs [71:105]
public bool PostEvent(string name, IDictionary<string, object> properties, IDictionary<string, object> piiProperties = null)
{
if (_telemetrySession == null)
{
return false;
}
TelemetryEvent telemetryEvent = new TelemetryEvent($"microsoft/slngen/{name}");
foreach (KeyValuePair<string, object> property in properties)
{
telemetryEvent.Properties[property.Key] = property.Value;
}
if (piiProperties != null)
{
foreach (KeyValuePair<string, object> property in piiProperties)
{
if (property.Value != null)
{
telemetryEvent.Properties[property.Key] = new TelemetryPiiProperty(property.Value);
}
}
}
Task.Run(() =>
{
if (_telemetrySession != null && !_telemetrySession.IsDisposed)
{
_telemetrySession?.PostEvent(telemetryEvent);
}
});
return true;
}