TelemetryWrapper.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using EnvironmentVariablesUILib.Models;
 6  using EnvironmentVariablesUILib.Telemetry;
 7  using Microsoft.PowerToys.Telemetry;
 8  
 9  namespace EnvironmentVariables.Telemetry
10  {
11      internal sealed class TelemetryWrapper : ITelemetry
12      {
13          public void LogEnvironmentVariablesProfileEnabledEvent(bool enabled)
14          {
15              var telemetryEnabled = new EnvironmentVariablesProfileEnabledEvent()
16              {
17                  Enabled = enabled,
18              };
19  
20              PowerToysTelemetry.Log.WriteEvent(telemetryEnabled);
21          }
22  
23          public void LogEnvironmentVariablesVariableChangedEvent(VariablesSetType type)
24          {
25              PowerToysTelemetry.Log.WriteEvent(new Telemetry.EnvironmentVariablesVariableChangedEvent(type));
26          }
27      }
28  }