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