mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-06 00:23:00 +08:00
Adding privacy event tags to each telemetry event. (#2879)
* Adding privacy event tags to each telemetry event. * Moving Privacy events to Telemetry base, Removing tag values, and fixing namespaces. * Adding documentation comments to fix style cop errors in release * UTCReplace_AppSessionGuid boolean property to all C# telemetry events. * Adding hardcoded version number to boot events. * Adding reference to telemetry in settings unittest * Adding Preview Pane events for loading w/ hardcoded version number * Adding telemetry.h to msi for svg and markdown events * removing unused explicit interface exception
This commit is contained in:
parent
d4b56f99ff
commit
34f814717b
@ -576,6 +576,7 @@
|
||||
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\powerpreview.dll" KeyPath="yes" />
|
||||
<!-- File to include common library used by preview handlers -->
|
||||
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PreviewHandlerCommon.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\Telemetry.dll" />
|
||||
<!-- File to include dll for Svg Preview Handler -->
|
||||
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\SvgPreviewHandler.dll" />
|
||||
<!-- Files to include dll's for Markdown Preview Handler and it's dependencies -->
|
||||
|
16
src/common/ManagedTelemetry/Telemetry/Events/EventBase.cs
Normal file
16
src/common/ManagedTelemetry/Telemetry/Events/EventBase.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Tracing;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.PowerToys.Telemetry.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// A base class to implement properties that are common to all telemetry events.
|
||||
/// </summary>
|
||||
[EventData]
|
||||
public class EventBase
|
||||
{
|
||||
public bool UTCReplace_AppSessionGuid => true;
|
||||
}
|
||||
}
|
11
src/common/ManagedTelemetry/Telemetry/Events/IEvent.cs
Normal file
11
src/common/ManagedTelemetry/Telemetry/Events/IEvent.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.PowerToys.Telemetry.Events
|
||||
{
|
||||
public interface IEvent
|
||||
{
|
||||
PartA_PrivTags PartA_PrivTags { get; }
|
||||
}
|
||||
}
|
@ -2,8 +2,9 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System.Diagnostics.Tracing;
|
||||
using PreviewHandlerCommon.Telemetry;
|
||||
|
||||
|
||||
namespace Microsoft.PowerToys.Telemetry
|
||||
{
|
||||
@ -12,7 +13,7 @@ namespace Microsoft.PowerToys.Telemetry
|
||||
/// </summary>
|
||||
public class PowerToysTelemetry : TelemetryBase
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Name for ETW event.
|
||||
/// </summary>
|
||||
@ -34,7 +35,8 @@ namespace Microsoft.PowerToys.Telemetry
|
||||
/// <summary>
|
||||
/// Publishes ETW event when an action is triggered on
|
||||
/// </summary>
|
||||
public void WriteEvent<T>(T telemetryEvent)
|
||||
public void WriteEvent<T>(T telemetryEvent)
|
||||
where T : EventBase, IEvent
|
||||
{
|
||||
this.Write<T>(null, new EventSourceOptions()
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Platforms>x64</Platforms>
|
||||
|
@ -4,8 +4,24 @@
|
||||
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
namespace PreviewHandlerCommon.Telemetry
|
||||
namespace Microsoft.PowerToys.Telemetry
|
||||
{
|
||||
/// <summary>
|
||||
/// Privacy Tag values
|
||||
/// </summary>
|
||||
public enum PartA_PrivTags
|
||||
: ulong
|
||||
{
|
||||
/// <nodoc/>
|
||||
None = 0,
|
||||
|
||||
/// <nodoc/>
|
||||
ProductAndServicePerformance = 0x0u,
|
||||
|
||||
/// <nodoc/>
|
||||
ProductAndServiceUsage = 0x0u,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base class for telemetry events.
|
||||
/// </summary>
|
||||
|
@ -0,0 +1,23 @@
|
||||
// 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 Microsoft.PowerLauncher.Telemetry
|
||||
{
|
||||
[EventData]
|
||||
public class SettingsBootEvent : EventBase, IEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets The version string. TODO: This should be replaced by a P/Invoke call to get_product_version
|
||||
/// </summary>
|
||||
public string Version => "v0.18.0";
|
||||
|
||||
public double BootTimeMs { get; set; }
|
||||
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServicePerformance;
|
||||
}
|
||||
}
|
@ -1,12 +1,16 @@
|
||||
using System.Diagnostics.Tracing;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.Telemetry
|
||||
{
|
||||
[EventData]
|
||||
public class SettingsEnabledEvent
|
||||
public class SettingsEnabledEvent : EventBase, IEvent
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public bool Value { get; set; }
|
||||
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,9 @@
|
||||
|
||||
using System;
|
||||
using System.Windows;
|
||||
using Microsoft.PowerLauncher.Telemetry;
|
||||
using Microsoft.PowerToys.Settings.UI.Views;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.Toolkit.Wpf.UI.XamlHost;
|
||||
using Windows.UI.Popups;
|
||||
|
||||
@ -14,8 +16,14 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
{
|
||||
var bootTime = new System.Diagnostics.Stopwatch();
|
||||
bootTime.Start();
|
||||
|
||||
this.InitializeComponent();
|
||||
bootTime.Stop();
|
||||
|
||||
PowerToysTelemetry.Log.WriteEvent(new SettingsBootEvent() { BootTimeMs = bootTime.ElapsedMilliseconds });
|
||||
}
|
||||
|
||||
private void WindowsXamlHost_ChildChanged(object sender, EventArgs e)
|
||||
@ -29,7 +37,7 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
|
||||
// send IPC Message
|
||||
shellPage.SetDefaultSndMessageCallback(msg =>
|
||||
{
|
||||
//IPC Manager is null when launching runner directly
|
||||
// IPC Manager is null when launching runner directly
|
||||
Program.GetTwoWayIPCManager()?.Send(msg);
|
||||
});
|
||||
|
||||
|
@ -68,6 +68,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\interop\interop.vcxproj" />
|
||||
<ProjectReference Include="..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI.Lib\Microsoft.PowerToys.Settings.UI.Lib.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI\Microsoft.PowerToys.Settings.UI.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -231,6 +231,10 @@
|
||||
</AdditionalFiles>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj">
|
||||
<Project>{5d00d290-4016-4cfe-9e41-1e7c724509ba}</Project>
|
||||
<Name>Telemetry</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI.Lib\Microsoft.PowerToys.Settings.UI.Lib.csproj">
|
||||
<Project>{b1bcc8c6-46b5-4bfa-8f22-20f32d99ec6a}</Project>
|
||||
<Name>Microsoft.PowerToys.Settings.UI.Lib</Name>
|
||||
|
@ -1,191 +1,195 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProjectGuid>{A80355C2-780D-4245-BD80-25B8DE698EE3}</ProjectGuid>
|
||||
<OutputType>AppContainerExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.PowerToys.Settings.UnitTest</RootNamespace>
|
||||
<AssemblyName>Microsoft.PowerToys.Settings.UnitTest</AssemblyName>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
|
||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion>
|
||||
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
|
||||
<OutputPath>bin\ARM64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\Test\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>false</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<SDKReference Include="TestPlatform.Universal, Version=$(UnitTestPlatformVersion)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ViewModelTests\FancyZones.cs" />
|
||||
<Compile Include="ViewModelTests\General.cs" />
|
||||
<Compile Include="ModelsTests\HelperTest.cs" />
|
||||
<Compile Include="ViewModelTests\ImageResizer.cs" />
|
||||
<Compile Include="ModelsTests\BasePTModuleSettingsTest.cs" />
|
||||
<Compile Include="ModelsTests\BasePTSettingsTest.cs" />
|
||||
<Compile Include="ModelsTests\SettingsUtilsTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UnitTestApp.xaml.cs">
|
||||
<DependentUpon>UnitTestApp.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewModelTests\PowerRename.cs" />
|
||||
<Compile Include="ViewModelTests\PowerPreview.cs" />
|
||||
<Compile Include="ViewModelTests\ShortcutGuide.cs" />
|
||||
<Compile Include="ViewModelTests\PowerLauncherViewModelTest.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="UnitTestApp.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
|
||||
<Version>6.2.9</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestAdapter">
|
||||
<Version>2.1.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestFramework">
|
||||
<Version>2.1.1</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI.Lib\Microsoft.PowerToys.Settings.UI.Lib.csproj">
|
||||
<Project>{b1bcc8c6-46b5-4bfa-8f22-20f32d99ec6a}</Project>
|
||||
<Name>Microsoft.PowerToys.Settings.UI.Lib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI\Microsoft.PowerToys.Settings.UI.csproj">
|
||||
<Project>{a7d5099e-f0fd-4bf3-8522-5a682759f915}</Project>
|
||||
<Name>Microsoft.PowerToys.Settings.UI</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProjectGuid>{A80355C2-780D-4245-BD80-25B8DE698EE3}</ProjectGuid>
|
||||
<OutputType>AppContainerExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.PowerToys.Settings.UnitTest</RootNamespace>
|
||||
<AssemblyName>Microsoft.PowerToys.Settings.UnitTest</AssemblyName>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
|
||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion>
|
||||
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
|
||||
<OutputPath>bin\ARM64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\Test\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>false</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<SDKReference Include="TestPlatform.Universal, Version=$(UnitTestPlatformVersion)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ViewModelTests\FancyZones.cs" />
|
||||
<Compile Include="ViewModelTests\General.cs" />
|
||||
<Compile Include="ModelsTests\HelperTest.cs" />
|
||||
<Compile Include="ViewModelTests\ImageResizer.cs" />
|
||||
<Compile Include="ModelsTests\BasePTModuleSettingsTest.cs" />
|
||||
<Compile Include="ModelsTests\BasePTSettingsTest.cs" />
|
||||
<Compile Include="ModelsTests\SettingsUtilsTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UnitTestApp.xaml.cs">
|
||||
<DependentUpon>UnitTestApp.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewModelTests\PowerRename.cs" />
|
||||
<Compile Include="ViewModelTests\PowerPreview.cs" />
|
||||
<Compile Include="ViewModelTests\ShortcutGuide.cs" />
|
||||
<Compile Include="ViewModelTests\PowerLauncherViewModelTest.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="UnitTestApp.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
|
||||
<Version>6.2.9</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestAdapter">
|
||||
<Version>2.1.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestFramework">
|
||||
<Version>2.1.1</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj">
|
||||
<Project>{5d00d290-4016-4cfe-9e41-1e7c724509ba}</Project>
|
||||
<Name>Telemetry</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI.Lib\Microsoft.PowerToys.Settings.UI.Lib.csproj">
|
||||
<Project>{b1bcc8c6-46b5-4bfa-8f22-20f32d99ec6a}</Project>
|
||||
<Name>Microsoft.PowerToys.Settings.UI.Lib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI\Microsoft.PowerToys.Settings.UI.csproj">
|
||||
<Project>{a7d5099e-f0fd-4bf3-8522-5a682759f915}</Project>
|
||||
<Name>Microsoft.PowerToys.Settings.UI</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
-->
|
||||
</Project>
|
@ -1,10 +1,19 @@
|
||||
using System.Diagnostics.Tracing;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
namespace Microsoft.PowerLauncher.Telemetry
|
||||
{
|
||||
[EventData]
|
||||
public class LauncherBootEvent
|
||||
public class LauncherBootEvent : EventBase, IEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// TODO: This should be replaced by a P/Invoke call to get_product_version
|
||||
/// </summary>
|
||||
public string Version => "v0.18.0";
|
||||
|
||||
public double BootTimeMs { get; set; }
|
||||
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServicePerformance;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,16 @@
|
||||
using System.Diagnostics.Tracing;
|
||||
// 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 Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
namespace Microsoft.PowerLauncher.Telemetry
|
||||
{
|
||||
[EventData]
|
||||
public class LauncherFirstDeleteEvent
|
||||
public class LauncherFirstDeleteEvent : EventBase, IEvent
|
||||
{
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
using System.Diagnostics.Tracing;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
|
||||
namespace Microsoft.PowerLauncher.Telemetry
|
||||
{
|
||||
[EventData]
|
||||
public class LauncherHideEvent
|
||||
public class LauncherHideEvent : EventBase, IEvent
|
||||
{
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
using System.Diagnostics.Tracing;
|
||||
// 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 Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
namespace Microsoft.PowerLauncher.Telemetry
|
||||
{
|
||||
@ -6,11 +12,13 @@ namespace Microsoft.PowerLauncher.Telemetry
|
||||
/// ETW Event for when the user initiates a query
|
||||
/// </summary>
|
||||
[EventData]
|
||||
public class LauncherQueryEvent
|
||||
public class LauncherQueryEvent : EventBase, IEvent
|
||||
{
|
||||
public double QueryTimeMs { get; set; }
|
||||
public int QueryLength { get; set; }
|
||||
public int NumResults { get; set; }
|
||||
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServicePerformance;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
using System.Diagnostics.Tracing;
|
||||
// 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 Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
namespace Microsoft.PowerLauncher.Telemetry
|
||||
{
|
||||
@ -6,7 +12,7 @@ namespace Microsoft.PowerLauncher.Telemetry
|
||||
/// ETW event for when a result is actioned.
|
||||
/// </summary>
|
||||
[EventData]
|
||||
public class LauncherResultActionEvent
|
||||
public class LauncherResultActionEvent : EventBase, IEvent
|
||||
{
|
||||
|
||||
public enum TriggerType
|
||||
@ -18,5 +24,7 @@ namespace Microsoft.PowerLauncher.Telemetry
|
||||
public string Trigger { get; set; }
|
||||
public string PluginName { get; set; }
|
||||
public string ActionName { get; set; }
|
||||
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,16 @@
|
||||
using System.Diagnostics.Tracing;
|
||||
// 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 Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
namespace Microsoft.PowerLauncher.Telemetry
|
||||
{
|
||||
[EventData]
|
||||
public class LauncherShowEvent
|
||||
public class LauncherShowEvent : EventBase, IEvent
|
||||
{
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
||||
|
@ -107,6 +107,10 @@
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj">
|
||||
<Project>{5d00d290-4016-4cfe-9e41-1e7c724509ba}</Project>
|
||||
<Name>Telemetry</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\PowerLauncher.Telemetry\PowerLauncher.Telemetry.csproj">
|
||||
<Project>{08c8c05f-0362-41bc-818c-724572df8b06}</Project>
|
||||
<Name>PowerLauncher.Telemetry</Name>
|
||||
|
@ -101,7 +101,6 @@
|
||||
<Compile Include="Generated Files\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MarkdownTelemetry.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
@ -112,6 +111,9 @@
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Telemetry\Events\MarkdownFileHandlerLoaded.cs" />
|
||||
<Compile Include="Telemetry\Events\MarkdownFilePreviewed.cs" />
|
||||
<Compile Include="Telemetry\Events\MarkdownFilePreviewError.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="HtmlAgilityPack">
|
||||
@ -132,6 +134,10 @@
|
||||
</AdditionalFiles>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj">
|
||||
<Project>{5D00D290-4016-4CFE-9E41-1E7C724509BA}</Project>
|
||||
<Name>Telemetry</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\common\PreviewHandlerCommon.csproj">
|
||||
<Project>{af2349b8-e5b6-4004-9502-687c1c7730b1}</Project>
|
||||
<Name>PreviewHandlerCommon</Name>
|
||||
|
@ -0,0 +1,25 @@
|
||||
// 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 MarkdownPreviewHandler.Telemetry.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// A telemetry event that is triggered when a markdown file is viewed in the preview pane.
|
||||
/// </summary>
|
||||
[EventData]
|
||||
public class MarkdownFileHandlerLoaded : EventBase, IEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets The version string. TODO: This should be replaced by a P/Invoke call to get_product_version.
|
||||
/// </summary>
|
||||
public string Version => "v0.18.0";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
// 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 Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
|
||||
namespace MarkdownPreviewHandler.Telemetry.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// A telemetry event that is triggered when an error occurs while attempting to view a markdown file in the preview pane.
|
||||
/// </summary>
|
||||
public class MarkdownFilePreviewError : EventBase, IEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the error message.
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServicePerformance;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// 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 MarkdownPreviewHandler.Telemetry.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// A telemetry event that is triggered when a markdown file is viewed in the preview pane.
|
||||
/// </summary>
|
||||
[EventData]
|
||||
public class MarkdownFilePreviewed : EventBase, IEvent
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Common;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
|
||||
namespace MarkdownPreviewHandler
|
||||
{
|
||||
@ -27,6 +28,7 @@ namespace MarkdownPreviewHandler
|
||||
/// <inheritdoc />
|
||||
protected override IPreviewHandlerControl CreatePreviewHandlerControl()
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new Telemetry.Events.MarkdownFileHandlerLoaded());
|
||||
this.markdownPreviewHandlerControl = new MarkdownPreviewHandlerControl();
|
||||
return this.markdownPreviewHandlerControl;
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ using System.Windows.Forms;
|
||||
using Common;
|
||||
using Markdig;
|
||||
using MarkdownPreviewHandler.Properties;
|
||||
using MarkdownPreviewHandler.Telemetry.Events;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using PreviewHandlerCommon;
|
||||
|
||||
namespace MarkdownPreviewHandler
|
||||
@ -112,11 +114,11 @@ namespace MarkdownPreviewHandler
|
||||
}
|
||||
});
|
||||
|
||||
MarkdownTelemetry.Log.MarkdownFilePreviewed();
|
||||
PowerToysTelemetry.Log.WriteEvent(new MarkdownFilePreviewed());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MarkdownTelemetry.Log.MarkdownFilePreviewError(e.Message);
|
||||
PowerToysTelemetry.Log.WriteEvent(new MarkdownFilePreviewError { Message = e.Message });
|
||||
|
||||
this.InvokeOnControlThread(() =>
|
||||
{
|
||||
|
@ -1,71 +0,0 @@
|
||||
// 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 PreviewHandlerCommon.Telemetry;
|
||||
|
||||
namespace MarkdownPreviewHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Telemetry helper class for markdown renderer.
|
||||
/// </summary>
|
||||
public class MarkdownTelemetry : TelemetryBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Name for ETW event.
|
||||
/// </summary>
|
||||
private const string EventSourceName = "Microsoft.PowerToys";
|
||||
|
||||
/// <summary>
|
||||
/// ETW event name when markdown is previewed.
|
||||
/// </summary>
|
||||
private const string MarkdownFilePreviewedEventName = "PowerPreview_MDRenderer_Previewed";
|
||||
|
||||
/// <summary>
|
||||
/// ETW event name when error is thrown during markdown preview.
|
||||
/// </summary>
|
||||
private const string MarkdownFilePreviewErrorEventName = "PowerPreview_MDRenderer_Error";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MarkdownTelemetry"/> class.
|
||||
/// </summary>
|
||||
public MarkdownTelemetry()
|
||||
: base(EventSourceName)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an instance of the <see cref="MarkdownTelemetry"/> class.
|
||||
/// </summary>
|
||||
public static MarkdownTelemetry Log { get; } = new MarkdownTelemetry();
|
||||
|
||||
/// <summary>
|
||||
/// Publishes ETW event when markdown is previewed successfully.
|
||||
/// </summary>
|
||||
public void MarkdownFilePreviewed()
|
||||
{
|
||||
this.Write(MarkdownFilePreviewedEventName, new EventSourceOptions()
|
||||
{
|
||||
Keywords = ProjectKeywordMeasure,
|
||||
Tags = ProjectTelemetryTagProductAndServicePerformance,
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Publishes ETW event when markdown could not be previewed.
|
||||
/// </summary>
|
||||
public void MarkdownFilePreviewError(string message)
|
||||
{
|
||||
this.Write(
|
||||
MarkdownFilePreviewErrorEventName,
|
||||
new EventSourceOptions()
|
||||
{
|
||||
Keywords = ProjectKeywordMeasure,
|
||||
Tags = ProjectTelemetryTagProductAndServicePerformance,
|
||||
},
|
||||
new { Message = message, });
|
||||
}
|
||||
}
|
||||
}
|
@ -14,7 +14,9 @@ using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using Common;
|
||||
using Common.Utilities;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using PreviewHandlerCommon;
|
||||
using SvgPreviewHandler.Telemetry.Events;
|
||||
using SvgPreviewHandler.Utilities;
|
||||
|
||||
namespace SvgPreviewHandler
|
||||
@ -69,11 +71,11 @@ namespace SvgPreviewHandler
|
||||
this.AddBrowserControl(svgData);
|
||||
this.Resize += this.FormResized;
|
||||
base.DoPreview(dataSource);
|
||||
SvgTelemetry.Log.SvgFilePreviewed();
|
||||
PowerToysTelemetry.Log.WriteEvent(new SvgFilePreviewed());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvgTelemetry.Log.SvgFilePreviewError(ex.Message);
|
||||
PowerToysTelemetry.Log.WriteEvent(new SvgFilePreviewError { Message = ex.Message });
|
||||
this.Controls.Clear();
|
||||
this.infoBarAdded = true;
|
||||
this.AddTextBoxControl(Resource.SvgNotPreviewedError);
|
||||
|
@ -5,6 +5,7 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Common;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
|
||||
namespace SvgPreviewHandler
|
||||
{
|
||||
@ -27,6 +28,7 @@ namespace SvgPreviewHandler
|
||||
/// <inheritdoc/>
|
||||
protected override IPreviewHandlerControl CreatePreviewHandlerControl()
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new Telemetry.Events.SvgFileHandlerLoaded());
|
||||
this.svgPreviewControl = new SvgPreviewControl();
|
||||
return this.svgPreviewControl;
|
||||
}
|
||||
|
@ -107,10 +107,16 @@
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SvgPreviewHandler.cs" />
|
||||
<Compile Include="SvgTelemetry.cs" />
|
||||
<Compile Include="Telemetry\Events\SvgFileHandlerLoaded.cs" />
|
||||
<Compile Include="Telemetry\Events\SvgFilePreviewed.cs" />
|
||||
<Compile Include="Telemetry\Events\SvgFilePreviewError.cs" />
|
||||
<Compile Include="Utilities\SvgPreviewHandlerHelper.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj">
|
||||
<Project>{5D00D290-4016-4CFE-9E41-1E7C724509BA}</Project>
|
||||
<Name>Telemetry</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\common\PreviewHandlerCommon.csproj">
|
||||
<Project>{af2349b8-e5b6-4004-9502-687c1c7730b1}</Project>
|
||||
<Name>PreviewHandlerCommon</Name>
|
||||
|
@ -1,70 +0,0 @@
|
||||
// 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 PreviewHandlerCommon.Telemetry;
|
||||
|
||||
namespace SvgPreviewHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Telemetry helper class for Svg renderer.
|
||||
/// </summary>
|
||||
public class SvgTelemetry : TelemetryBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Name for ETW event.
|
||||
/// </summary>
|
||||
private const string EventSourceName = "Microsoft.PowerToys";
|
||||
|
||||
/// <summary>
|
||||
/// ETW event name when Svg is previewed.
|
||||
/// </summary>
|
||||
private const string SvgFilePreviewedEventName = "PowerPreview_SVGRenderer_Previewed";
|
||||
|
||||
/// <summary>
|
||||
/// ETW event name when error is thrown during Svg preview.
|
||||
/// </summary>
|
||||
private const string SvgFilePreviewErrorEventName = "PowerPreview_SVGRenderer_Error";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SvgTelemetry"/> class.
|
||||
/// </summary>
|
||||
public SvgTelemetry()
|
||||
: base(EventSourceName)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an instance of the <see cref="SvgTelemetry"/> class.
|
||||
/// </summary>
|
||||
public static SvgTelemetry Log { get; } = new SvgTelemetry();
|
||||
|
||||
/// <summary>
|
||||
/// Publishes ETW event when svg is previewed successfully.
|
||||
/// </summary>
|
||||
public void SvgFilePreviewed()
|
||||
{
|
||||
this.Write(SvgFilePreviewedEventName, new EventSourceOptions()
|
||||
{
|
||||
Keywords = ProjectKeywordMeasure,
|
||||
Tags = ProjectTelemetryTagProductAndServicePerformance,
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Publishes ETW event when svg could not be previewed.
|
||||
/// </summary>
|
||||
public void SvgFilePreviewError(string message)
|
||||
{
|
||||
this.Write(
|
||||
SvgFilePreviewErrorEventName,
|
||||
new EventSourceOptions()
|
||||
{
|
||||
Keywords = ProjectKeywordMeasure,
|
||||
Tags = ProjectTelemetryTagProductAndServicePerformance,
|
||||
},
|
||||
new { Message = message, });
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
// 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 SvgPreviewHandler.Telemetry.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// A telemetry event to be raised when a svg file has been viewed in the preview pane.
|
||||
/// </summary>
|
||||
[EventData]
|
||||
public class SvgFileHandlerLoaded : EventBase, IEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets The version string. TODO: This should be replaced by a P/Invoke call to get_product_version.
|
||||
/// </summary>
|
||||
public string Version => "v0.18.0";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
// 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 SvgPreviewHandler.Telemetry.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// A telemetry event to be raised when an error has occured in the preview pane.
|
||||
/// </summary>
|
||||
[EventData]
|
||||
public class SvgFilePreviewError : EventBase, IEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the error messsage to log as part of the telemetry event.
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServicePerformance;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// 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 SvgPreviewHandler.Telemetry.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// A telemetry event to be raised when a svg file has been viewed in the preview pane.
|
||||
/// </summary>
|
||||
[EventData]
|
||||
public class SvgFilePreviewed : EventBase, IEvent
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
@ -93,9 +93,6 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\..\common\Telemetry\TelemetryBase.cs">
|
||||
<Link>Telemetry\TelemetryBase.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="cominterop\IInitializeWithFile.cs" />
|
||||
<Compile Include="cominterop\COLORREF.cs" />
|
||||
<Compile Include="cominterop\IInitializeWithStream.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user