global using Community.VisualStudio.Toolkit;
global using Microsoft.VisualStudio.Shell;
global using System;
global using Task = System.Threading.Tasks.Task;
using System.Runtime.InteropServices;
using System.Threading;
namespace TestExecWin_VS2022
{
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)]
[ProvideToolWindow(typeof(MyToolWindow.Pane), Style = VsDockStyle.Tabbed, Window = WindowGuids.SolutionExplorer)]
[ProvideMenuResource("Menus.ctmenu", 1)]
[Guid(PackageGuids.TestExecWin_VS2022String)]
[ProvideOptionPage(typeof(OptionPage), "TestExecWindow", "Options", 1, 1, true, new string[] { "TestExecWindow Options" })]
public sealed class TestExecWin_VS2022Package : ToolkitPackage
{
protected override async Task InitializeAsync(CancellationToken cancellationToken,
IProgress<ServiceProgressData> progress)
{
await this.RegisterCommandsAsync();
this.RegisterToolWindows();
MyGlobals.myPackage = this;
if (MyGlobals.myDTE == null)
{
await JoinableTaskFactory.SwitchToMainThreadAsync();
var dte = await this.GetServiceAsync(typeof(EnvDTE.DTE)) as EnvDTE80.DTE2;
Microsoft.Assumes.Present(dte);
MyGlobals.myDTE = dte;
VisualStudioConnector.dte = dte;
}
}
}
}