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); }
bool TryGetInfoBarHost(bool activeView, out IInfoBarHost infoBarHost) { AssertIsForeground(); infoBarHost = null; if (!IdeApp.IsInitialized || IdeApp.Workbench == null) { return(false); } if (activeView) { // Maybe for pads also? Not sure if we should. infoBarHost = IdeApp.Workbench.ActiveDocument as IInfoBarHost; } if (infoBarHost == null) { infoBarHost = IdeApp.Workbench.RootWindow as IInfoBarHost; } return(infoBarHost != null); }