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") { var props = new Dictionary <string, string> { { "matches", string.Join(", ", _suggestionResult.Matches) } }; infoBarUIElement.Close(); Settings.IgnoreFileType(_suggestionResult.Matches, true); } }
public void HideInfoBar() { if (_currentInfoBar != null && TryGetInfoBarData(out var _)) { _currentInfoBar.Close(); } }
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") { var props = new Dictionary<string, string> { { "matches", string.Join(", ", _suggestionResult.Matches) } }; infoBarUIElement.Close(); Settings.IgnoreFileType(_suggestionResult.Matches, true); } }
public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { var projectGuid = _vcProjectService.UnloadProject(_project); _vcProjectService.ReloadProject(projectGuid); ThreadHelper.ThrowIfNotOnUIThread(); infoBarUIElement.Close(); }
public void Dispose() { VsAppShell.Current.AssertIsOnMainThread(); _infoBarHost.RemoveInfoBar(_infoBar); _infoBar.Unadvise(_cookie); _infoBar.Close(); }
/// <summary> /// Signals this bar that it should close. /// </summary> public void Close() { if (_element == null) { return; } _element.Close(); _tcs.SetResult(_result); }
public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { var item = _infoBarActions.FirstOrDefault(i => i.Title == actionItem.Text); if (item != null) { _resulTaskCompletionSource.SetResult(item.Type); infoBarUIElement.Close(); } }
public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { try { ProjectService.Reload(_serviceProvider, _project); infoBarUIElement.Close(); } catch (System.Exception ex) { System.Diagnostics.Debug.Write(ex); } }
public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { if (actionItem.Equals(s_enableItem)) { _onEnableClicked(); } if (actionItem.Equals(s_enableAndIgnoreItem)) { _onEnableAndIgnoreClicked(); } infoBarUIElement.Close(); }
public void OnClosed(IVsInfoBarUIElement infoBarUIElement) { if (_infoBar != null) { if (_infoBarAdviseCookie != 0) { _infoBar.Unadvise(_infoBarAdviseCookie); _infoBarAdviseCookie = 0; } // Remember this for next time CookiecutterPackage.Instance.ShowHelp = false; RemoveInfoBar(_infoBar); _infoBar.Close(); _infoBar = null; } }
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(); }
public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { string context = actionItem.ActionContext as string; switch (context) { case "New": { Process.Start("https://github.com/wmjordan/Codist/releases"); break; } case "More": Process.Start("https://github.com/wmjordan/Codist"); break; case "Close": break; } _InfoBarUI.Close(); }
public void CloseInfoBar() { if (element != null) { var shell = _serviceProvider.GetService(typeof(SVsShell)) as IVsShell; if (shell != null) { shell.GetProperty((int)__VSSPROPID7.VSSPROPID_MainWindowInfoBarHost, out var obj); var host = (IVsInfoBarHost)obj; if (host == null) { return; } element.Close(); host.RemoveInfoBar(element); element = null; } } }
public void OnClosed(IVsInfoBarUIElement infoBarUIElement) { if (_infoBar != null) { if (_infoBarAdviseCookie != 0) { _infoBar.Unadvise(_infoBarAdviseCookie); _infoBarAdviseCookie = 0; } if (!_missingDependencies) { // Save this for later time CookiecutterPackage.Instance.ShowHelp = false; } RemoveInfoBar(_infoBar); _infoBar.Close(); _infoBar = null; } }
public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem) { if (actionItem.Equals(s_enableItem)) { _onEnableClicked?.Invoke(); } if (actionItem.Equals(s_enableAndIgnoreItem)) { _onEnableAndIgnoreClicked?.Invoke(); } infoBarUIElement.Close(); }
protected void Close() { _infoBar?.Close(); }
public void Dispose() { _infoBar?.Close(); _idleManager.OnIdle -= OnIdle; _idleManager.Dispose(); }