public static void PostEvent(string key, params object[] namesAndProperties) { if (string.IsNullOrEmpty(key)) { return; } ThreadHelper.ThrowIfNotOnUIThread(); IVsTelemetryEvent telemetryEvent = TelemetryHelper.TelemetryService.CreateEvent(key); //telemetryEvent.SetStringProperty("Vs.ReportingAssembly", callingAssemblyName); for (int i = 0; i < namesAndProperties.Length; i += 2) { string propertyName = namesAndProperties[i] as string; if (!string.IsNullOrEmpty(propertyName)) { telemetryEvent.SetProperty(propertyName, namesAndProperties[i + 1]); } } TelemetryHelper.DefaultTelemetrySession.PostEvent(telemetryEvent); }
private void SetBlockId(IVsTelemetryEvent telemetryEvent, FunctionId functionId, int blockId) { var blockIdName = functionId.GetPropertyName(BlockId); telemetryEvent.SetIntProperty(blockIdName, blockId); }