示例#1
0
        public static IPoderosaAboutBoxFactory GetCurrentAboutBoxFactory()
        {
            //AboutBox実装を見つける
            if (AboutBoxUtil.AboutBoxID == null)
            {
                return(null);
            }
            string factory_id = AboutBoxUtil.AboutBoxID.Value;
            IPoderosaAboutBoxFactory found_factory = null;

            IPoderosaAboutBoxFactory[] factories = (IPoderosaAboutBoxFactory[])WindowManagerPlugin.Instance.PoderosaWorld.PluginManager.FindExtensionPoint("org.poderosa.window.aboutbox").GetExtensions();
            foreach (IPoderosaAboutBoxFactory f in factories)
            {
                if (f.AboutBoxID == factory_id)
                {
                    found_factory = f;
                    break;
                }
                else if (f.AboutBoxID == DEFAULT_ABOUTBOX_ID) //TODO ちゃんとしたconst string参照
                {
                    found_factory = f;                        //このあとのループで正式に一致するやつが見つかったら上書きされることに注意
                }
            }

            Debug.Assert(found_factory != null);
            return(found_factory);
        }
示例#2
0
        public void ReloadPreference(ICoreServicePreference pref)
        {
            IPoderosaAboutBoxFactory af = AboutBoxUtil.GetCurrentAboutBoxFactory();

            if (af != null)
            {
                this.Icon = af.ApplicationIcon;
            }
            _toolStripContainer.ReloadPreference(pref);
        }
示例#3
0
        public PoderosaForm()
        {
            _contextMenusToDispose = new List <ContextMenuStrip>();

            components = new System.ComponentModel.Container();
            _contextMenuDisposeTimer       = new Timer(components);
            _contextMenuDisposeTimer.Tick += new EventHandler(ContextMenuDisposeTimerTick);

            _messageBoxInternalDelegate = new MessageBoxInternalDelegate(this.MessageBoxInternal);

            IPoderosaAboutBoxFactory aboutBoxFactory = AboutBoxUtil.GetCurrentAboutBoxFactory();

            if (aboutBoxFactory != null)
            {
                this.Icon = aboutBoxFactory.ApplicationIcon;
            }

            //ショートカットキーは共通
            _commandKeyHandler = new KeyboardHandlerManager();
            _commandKeyHandler.AddLastHandler(new CommandShortcutKeyHandler(this));
        }
示例#4
0
        //AboutBox表示のメニューとコマンド
        private static CommandResult CmdAboutBox(ICommandTarget target)
        {
            IPoderosaMainWindow window = CommandTargetUtil.AsWindow(target);

            if (window == null)
            {
                return(CommandResult.Ignored);
            }

            IPoderosaAboutBoxFactory f = AboutBoxUtil.GetCurrentAboutBoxFactory();

            if (f != null)
            {
                AboutBoxUtil.ResetKeyBufferInAboutBox();
                f.CreateAboutBox().ShowDialog(window.AsForm());
                return(CommandResult.Succeeded);
            }
            else
            {
                return(CommandResult.Failed);
            }
        }