Adding launcher telemetry for context buttons clicked.

This commit is contained in:
ryanbodrug-microsoft
2020-05-05 09:02:28 -07:00
parent e29e8ca0a3
commit a9cc4dabb7
11 changed files with 186 additions and 122 deletions

View File

@@ -1,4 +1,6 @@
using System.Drawing;
using Microsoft.PowerLauncher.Telemetry;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Input;
using Wox.Plugin;
@@ -6,6 +8,7 @@ namespace Wox.ViewModel
{
public class ContextMenuItemViewModel : BaseModel
{
public string PluginName { get; set; }
public string Title { get; set; }
public string Glyph { get; set; }
public string FontFamily { get; set; }
@@ -13,5 +16,17 @@ namespace Wox.ViewModel
public string AcceleratorKey { get; set; }
public string AcceleratorModifiers { get; set; }
public bool IsAcceleratorKeyEnabled { get; set; }
public void SendTelemetryEvent(ResultActionEvent.TriggerType triggerType)
{
var eventData = new ResultActionEvent()
{
PluginName = PluginName,
Trigger = triggerType,
ActionName = Title
};
PowerLauncherTelemetry.Log.WriteEvent(eventData);
}
}
}

View File

@@ -119,6 +119,7 @@ namespace Wox.ViewModel
{
newItems.Add(new ContextMenuItemViewModel
{
PluginName = r.PluginName,
Title = r.Title,
Glyph = r.Glyph,
FontFamily = r.FontFamily,