[telemetry][ColorPicker] add event name support (#10476)

Allow to set a custom name for the event instead of just using the
class name.
This commit is contained in:
Enrico Giordani 2021-03-29 11:20:49 +02:00 committed by GitHub
parent 9a3896f48a
commit ccc380f11c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 1 deletions

View file

@ -16,6 +16,8 @@ namespace Microsoft.PowerToys.Telemetry.Events
{
public bool UTCReplace_AppSessionGuid => true;
public string EventName { get; set; }
private string _version;
public string Version

View file

@ -37,7 +37,7 @@ namespace Microsoft.PowerToys.Telemetry
where T : EventBase, IEvent
{
this.Write<T>(
null,
telemetryEvent.EventName,
new EventSourceOptions()
{
Keywords = ProjectKeywordMeasure,

View file

@ -12,6 +12,11 @@ namespace ColorPicker.Telemetry
[EventData]
public class ColorPickerSession : EventBase, IEvent
{
public ColorPickerSession()
{
EventName = "ColorPicker_Session";
}
public string StartedAs { get; set; }
public bool ZoomUsed { get; set; }

View file

@ -15,6 +15,7 @@ namespace ColorPicker.Telemetry
public ColorPickerSettings(IDictionary<string, bool> editorFormats)
{
EditorFormats = editorFormats;
EventName = "ColorPicker_Settings";
}
public string ActivationShortcut { get; set; }