public async void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { string context = actionItem.ActionContext; if (context == "install") { InstallerDialog dialog = new InstallerDialog(_suggestionResult.Extensions); dialog.NeverShowAgainForSolution = Settings.IsFileTypeIgnored(_suggestionResult.Matches); var dte = _serviceProvider.GetService(typeof(DTE)) as DTE2; var hwnd = new IntPtr(dte.MainWindow.HWnd); System.Windows.Window window = (System.Windows.Window)HwndSource.FromHwnd(hwnd).RootVisual; dialog.Owner = window; var result = dialog.ShowDialog(); Settings.IgnoreFileType(_suggestionResult.Matches, dialog.NeverShowAgainForSolution); if (!result.HasValue || !result.Value) return; ExtensionInstaller installer = new ExtensionInstaller(_serviceProvider, _repository, _manager); await installer.InstallExtensions(dialog.SelectedExtensions); } else if (context == "ignore") { Settings.IgnoreFileType(_suggestionResult.Matches, true); } }
public async void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { string context = actionItem.ActionContext; if (context == "install") { InstallerDialog dialog = new InstallerDialog(_suggestionResult.Extensions); dialog.NeverShowAgainForSolution = Settings.IsFileTypeIgnored(_suggestionResult.Matches); var result = dialog.ShowDialog(); Settings.IgnoreFileType(_suggestionResult.Matches, dialog.NeverShowAgainForSolution); if (!result.HasValue || !result.Value) return; ExtensionInstaller installer = new ExtensionInstaller(_repository, _manager); await installer.InstallExtensions(dialog.SelectedExtensions); } else if (context == "ignore") { Settings.IgnoreFileType(_suggestionResult.Matches, true); } }
public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { if (actionItem.Equals(s_enableItem)) { _onEnableClicked?.Invoke(); } if (actionItem.Equals(s_enableAndIgnoreItem)) { _onEnableAndIgnoreClicked?.Invoke(); } infoBarUIElement.Close(); }
public void SimulateClickEvent(IVsInfoBarActionItem item = null) { this.sinks.Values.ToList().ForEach(v => v.OnActionItemClicked(this, item)); }
public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { if (actionItem.Equals(_customizeInfoBarButton)) { var optionsCommand = new CommandID( VSConstants.GUID_VSStandardCommandSet97, VSConstants.cmdidToolsOptions); var menuCommandService = _provider.GetService(typeof(IMenuCommandService)) as MenuCommandService; string intelliSenseOptionsGuidString = typeof(NodejsIntellisenseOptionsPage).GUID.ToString(); menuCommandService.GlobalInvoke(optionsCommand, intelliSenseOptionsGuidString); } else if (actionItem.Equals(_typingsFolderHyperlink)) { Process.Start("http://go.microsoft.com/fwlink/?LinkID=808345"); } }
public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { var item = _items.FirstOrDefault(i => i.Title == actionItem.Text); if (item.IsDefault) { return; } item.Action?.Invoke(); if (!item.CloseAfterAction) { return; } infoBarUIElement.Close(); }
void IVsInfoBarUIEvents.OnActionItemClicked(IVsInfoBarUIElement uiElement, IVsInfoBarActionItem actionItem) { this.ButtonClick?.Invoke(this, EventArgs.Empty); }
public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { ((Action)actionItem.ActionContext)(); }