コード例 #1
0
ファイル: Workbench.cs プロジェクト: Redth/monodevelop-1
        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);
        }
コード例 #2
0
        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);
        }