-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBreakpointNotifierPackage.cs
More file actions
51 lines (44 loc) · 1.62 KB
/
BreakpointNotifierPackage.cs
File metadata and controls
51 lines (44 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Runtime.InteropServices;
using System.Threading;
using CodingWithCalvin.Otel4Vsix;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Task = System.Threading.Tasks.Task;
namespace CodingWithCalvin.BreakpointNotifier
{
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)]
[Guid("136f3004-4048-4dd9-bd6d-7ff910b2c900")]
[ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)]
public sealed class BreakpointNotifierPackage : AsyncPackage
{
protected override async Task InitializeAsync(
CancellationToken cancellationToken,
IProgress<ServiceProgressData> progress
)
{
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
var builder = VsixTelemetry.Configure()
.WithServiceName(VsixInfo.DisplayName)
.WithServiceVersion(VsixInfo.Version)
.WithVisualStudioAttributes(this)
.WithEnvironmentAttributes();
#if !DEBUG
builder
.WithOtlpHttp("https://api.honeycomb.io")
.WithHeader("x-honeycomb-team", HoneycombConfig.ApiKey);
#endif
builder.Initialize();
DebuggerEvents.Initialize();
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
VsixTelemetry.Shutdown();
}
base.Dispose(disposing);
}
}
}