Datei: NDOPackage/Commands/AddAccessor.cs

Last Commit (4a7e8ab)
1 -- File didn't exist --
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
New Commit (3030986)
1 using System.Diagnostics;
2
3 namespace NDOVsPackage.Commands
4 {
5 ····[Command(PackageGuids.guidNDOPackageCmdSetString, PackageIds.cmdidAddAccessor)]
6 ····internal sealed class AddAccessor : BaseCommand<AddAccessor>
7 ····{
8 ········protected override async Task ExecuteAsync(OleMenuCmdEventArgs e)
9 ········{
10 ············await VS.MessageBox.ShowWarningAsync("NDOPackage", "Button clicked");
11 ········}
12 ········protected override void BeforeQueryStatus(EventArgs e)
13 ········{
14 ············ThreadHelper.JoinableTaskFactory.Run(async () =>
15 ············{
16 ················var active = await VS.Documents.GetActiveDocumentViewAsync();
17 ················var enabled = active.FilePath.EndsWith(".cs") || active.FilePath.EndsWith(".vb");
18 ················await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
19 ················Command.Enabled = enabled;
20 ············});
21 ········}
22 ····}
23 }
24