[PowerOCR][Telemetry]Cancel and capture events (#20165)

This commit is contained in:
Jaime Bernardo
2022-08-31 15:41:21 +01:00
committed by GitHub
parent fcfbb67123
commit 76ebed0897
5 changed files with 38 additions and 2 deletions

View File

@@ -77,7 +77,7 @@ public static class WindowUtilities
allFullscreenGrab.Add(overlay);
}
PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRLaunchOverlayEvent());
PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRInvokedEvent());
}
internal static bool IsOCROverlayCreated()

View File

@@ -8,6 +8,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using Microsoft.PowerToys.Telemetry;
using PowerOCR.Helpers;
using PowerOCR.Utilities;
@@ -101,6 +102,7 @@ public partial class OCROverlay : Window
{
case Key.Escape:
WindowUtilities.CloseAllOCROverlays();
PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRCancelledEvent());
break;
default:
break;
@@ -276,11 +278,13 @@ public partial class OCROverlay : Window
}
WindowUtilities.CloseAllOCROverlays();
PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRCaptureEvent());
}
}
private void CancelMenuItem_Click(object sender, RoutedEventArgs e)
{
WindowUtilities.CloseAllOCROverlays();
PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRCancelledEvent());
}
}

View File

@@ -9,7 +9,7 @@ using Microsoft.PowerToys.Telemetry.Events;
namespace PowerOCR.Telemetry
{
[EventData]
public class PowerOCRLaunchOverlayEvent : EventBase, IEvent
public class PowerOCRCancelledEvent : EventBase, IEvent
{
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
}

View File

@@ -0,0 +1,16 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics.Tracing;
using Microsoft.PowerToys.Telemetry;
using Microsoft.PowerToys.Telemetry.Events;
namespace PowerOCR.Telemetry
{
[EventData]
public class PowerOCRCaptureEvent : EventBase, IEvent
{
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
}
}

View File

@@ -0,0 +1,16 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics.Tracing;
using Microsoft.PowerToys.Telemetry;
using Microsoft.PowerToys.Telemetry.Events;
namespace PowerOCR.Telemetry
{
[EventData]
public class PowerOCRInvokedEvent : EventBase, IEvent
{
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
}
}