-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopyQualifiedNamePackage.cs
More file actions
34 lines (28 loc) · 1.47 KB
/
CopyQualifiedNamePackage.cs
File metadata and controls
34 lines (28 loc) · 1.47 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
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Community.VisualStudio.Toolkit;
using Microsoft.VisualStudio.Shell;
namespace CopyQualifiedName
{
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[Guid(PackageGuidString)]
[ProvideMenuResource("Menus.ctmenu", 1)]
[ProvideAutoLoad(Microsoft.VisualStudio.VSConstants.UICONTEXT.NoSolution_string, PackageAutoLoadFlags.BackgroundLoad)]
[ProvideAutoLoad(Microsoft.VisualStudio.VSConstants.UICONTEXT.SolutionExists_string, PackageAutoLoadFlags.BackgroundLoad)]
public sealed class CopyQualifiedNamePackage : ToolkitPackage
{
public const string PackageGuidString = "f8b3c5a7-9d2e-4f1a-b6c8-3e7d9f0a1b2c";
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
{
System.Diagnostics.Debug.WriteLine("CopyQualifiedName: Package InitializeAsync starting...");
await base.InitializeAsync(cancellationToken, progress);
// Switch to main thread for command registration
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
// Register commands
await this.RegisterCommandsAsync();
System.Diagnostics.Debug.WriteLine("CopyQualifiedName: Package InitializeAsync complete - commands registered.");
}
}
}