public void OnClosed(IVsInfoBarUIElement infoBarUIElement) { if (_InfoBarUI != null) { _InfoBarUI.Unadvise(_Cookie); } }
public void OnClosed(IVsInfoBarUIElement infoBarUIElement) { ThreadHelper.ThrowIfNotOnUIThread(); infoBarUIElement?.Unadvise(_cookie); _cookie = 0; _action = null; }
public void Dispose() { VsAppShell.Current.AssertIsOnMainThread(); _infoBarHost.RemoveInfoBar(_infoBar); _infoBar.Unadvise(_cookie); _infoBar.Close(); }
public void OnClosed(IVsInfoBarUIElement infoBarUIElement) { ThreadHelper.ThrowIfNotOnUIThread(); if (_InfoBarUI != null) { _InfoBarUI.Unadvise(_Cookie); } }
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 context = Convert.ToString(actionItem.ActionContext); switch (context) { case nameof(HyperlinkCommands.Configure): _ = infoBarUIElement.Unadvise(_cookie); var configWindow = new ConfigurationControl(); configWindow.ShowDialog(); break; case nameof(HyperlinkCommands.Later): _ = infoBarUIElement.Unadvise(_cookie); break; case nameof(HyperlinkCommands.No): NotificationService.PopMessage("Click Action", "You clicked No"); break; case nameof(HyperlinkCommands.Ok): NotificationService.PopMessage("Click Action", "You clicked Ok"); break; case nameof(HyperlinkCommands.Yes): NotificationService.PopMessage("Click Action", "You clicked Yes"); break; default: //close the thingy by default //or throw error maybe and display to the user??? _ = infoBarUIElement.Unadvise(_cookie); break; } }
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; } }
/// <inheritdoc/> public void OnClosed(IVsInfoBarUIElement infoBarUIElement) { this.isInfoBarOpen = false; infoBarUIElement.Unadvise(this.uiCookie); }
public void OnClosed(IVsInfoBarUIElement infoBarUIElement) { infoBarUIElement.Unadvise(_adviseCookie); _infoBar = null; }
public void OnClosed(IVsInfoBarUIElement infoBarUIElement) { infoBarUIElement.Unadvise(_cookie); }
public void OnClosed(IVsInfoBarUIElement infoBarUIElement) { Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); infoBarUIElement.Unadvise(cookie); }
/// <summary> /// Called when the bar has been closed. /// </summary> /// <param name="infoBarUIElement"></param> protected virtual void OnClosed(IVsInfoBarUIElement infoBarUIElement) { infoBarUIElement.Unadvise(_cookie); }
public void OnClosed(IVsInfoBarUIElement infoBarUiElement) { ThreadHelper.ThrowIfNotOnUIThread(); infoBarUiElement.Unadvise(_cookie); }
public void OnClosed(IVsInfoBarUIElement infoBarUIElement) { this.infoBar.Close(); uiElement.Unadvise(this.cookie); }
public static void Show(NodejsProjectNode projectNode) { var serviceProvider = projectNode.Site; serviceProvider.GetUIThread().MustBeCalledFromUIThread(); var vsShell = (IVsShell)serviceProvider.GetService(typeof(SVsShell)); var infoBarUIFactory = (IVsInfoBarUIFactory)serviceProvider.GetService(typeof(SVsInfoBarUIFactory)); if (ErrorHandler.Failed(vsShell.GetProperty((int)__VSSPROPID7.VSSPROPID_MainWindowInfoBarHost, out var tmp))) { // we don't want to crash just because we can't show the error bar return; } var infoBarHost = (IVsInfoBarHost)tmp; // make sure we close the previous infobar CurrentInfoBarElement?.Close(); Action downloadNode = DownloadNode; Action openProjectProps = ShowProjectProperties; var actionItems = new[] { new InfoBarHyperlink(Resources.ConfigureProjectProperties, openProjectProps), new InfoBarHyperlink(Resources.DownloadNodejs, downloadNode), }; var infoBarModel = new InfoBarModel(Resources.NodejsNotInstalledInfoBar, actionItems, isCloseButtonVisible: true, image: KnownMonikers.StatusError); uint eventCookie = 0; CurrentInfoBarElement = infoBarUIFactory.CreateInfoBar(infoBarModel); CurrentInfoBarElement.Advise(new InfoBarUIEvents(OnClose), out eventCookie); infoBarHost.AddInfoBar(CurrentInfoBarElement); void OnClose() { CurrentInfoBarElement.Unadvise(eventCookie); } void DownloadNode() { const string url = @"https://aka.ms/downloadnode"; VsShellUtilities.OpenBrowser(url, (uint)__VSOSPFLAGS.OSP_LaunchNewBrowser); } void ShowProjectProperties() { // open Project Properties var logicalView = VSConstants.LOGVIEWID_Primary; if (ErrorHandler.Succeeded(projectNode.GetGuidProperty(VSConstants.VSITEMID_ROOT, (int)VsHierarchyPropID.ProjectDesignerEditor, out var editorType)) && ErrorHandler.Succeeded(projectNode.OpenItemWithSpecific(VSConstants.VSITEMID_ROOT, 0, ref editorType, "", ref logicalView, (IntPtr)(-1), out var frame))) { frame?.Show(); } } }