-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOpenInNotepadPlusPlusPackage.cs
More file actions
62 lines (55 loc) · 1.96 KB
/
OpenInNotepadPlusPlusPackage.cs
File metadata and controls
62 lines (55 loc) · 1.96 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
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Runtime.InteropServices;
using System.Threading;
using CodingWithCalvin.OpenInNotepadPlusPlus.Commands;
using CodingWithCalvin.OpenInNotepadPlusPlus.Dialogs;
using CodingWithCalvin.Otel4Vsix;
using Microsoft.VisualStudio.Shell;
namespace CodingWithCalvin.OpenInNotepadPlusPlus
{
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration(VsixInfo.DisplayName, VsixInfo.Description, VsixInfo.Version)]
[ProvideOptionPage(
typeof(SettingsDialogPage),
VsixInfo.DisplayName,
"General",
101,
111,
true,
new string[0],
ProvidesLocalizedCategoryName = false
)]
[ProvideMenuResource("Menus.ctmenu", 1)]
[Guid("6AEABF47-7BDC-47B3-ADE7-06F5BAE6D868")]
public sealed class OpenInNotepadPlusPlusPackage : AsyncPackage
{
protected override async System.Threading.Tasks.Task InitializeAsync(
CancellationToken cancellationToken,
IProgress<ServiceProgressData> progress
)
{
await JoinableTaskFactory.SwitchToMainThreadAsync();
var settings = (SettingsDialogPage)this.GetDialogPage(typeof(SettingsDialogPage));
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();
OpenExecutableCommand.Initialize(this, settings);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
VsixTelemetry.Shutdown();
}
base.Dispose(disposing);
}
}
}