mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
[PowerOCR][Telemetry]Cancel and capture events (#20165)
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user