-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileUtilPackage.cs
More file actions
39 lines (34 loc) · 1.46 KB
/
FileUtilPackage.cs
File metadata and controls
39 lines (34 loc) · 1.46 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
using EnvDTE;
using EnvDTE80;
using Microsoft;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using Task = System.Threading.Tasks.Task;
namespace FileUtil
{
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[Guid(PackageGuidString)]
[ProvideMenuResource("Menus.ctmenu", 1)]
public sealed class FileUtilPackage : AsyncPackage
{
public const string PackageGuidString = "e4242fd4-6c82-4213-83bd-592a5903ad35";
internal static DTE2 Dte { get; private set; }
internal static IVsMonitorSelection MonitorSelection { get; private set; }
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
{
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
Dte = await GetServiceAsync(typeof(EnvDTE.DTE)) as DTE2;
//DTE2 dte = (DTE2)Package.GetGlobalService(typeof(DTE));
Assumes.Present(Dte);
MonitorSelection = await GetServiceAsync(typeof(IVsMonitorSelection)) as IVsMonitorSelection;
Assumes.Present(MonitorSelection);
await NewItemCmd.InitializeAsync(this);
await AlignByCmd.InitializeAsync(this);
}
}
}