Example #1
0
 void ShowInfoBar(bool activeView, string message, params InfoBarUI [] items)
 {
     // We can be called from any thread since errors can occur anywhere, however we can only construct and InfoBar from the UI thread.
     _foregroundNotificationService.RegisterNotification(() => {
         if (TryGetInfoBarHost(activeView, out var infoBarHost))
         {
             var options = new InfoBarOptions(message)
             {
                 Items = ToUIItems(items)
             };
             infoBarHost.AddInfoBar(options);
         }
     }, _listener.BeginAsyncOperation(nameof(ShowInfoBar)));
Example #2
0
        public void ShowInfoBar(bool inActiveView, InfoBarOptions options)
        {
            IInfoBarHost infoBarHost = null;

            if (inActiveView)
            {
                // Maybe for pads also? Not sure if we should.
                infoBarHost = IdeApp.Workbench.ActiveDocument?.GetContent <IInfoBarHost> (true);
            }

            if (infoBarHost == null)
            {
                infoBarHost = IdeApp.Workbench.RootWindow as IInfoBarHost;
            }

            infoBarHost?.AddInfoBar(options);
        }