示例#1
0
        private void AddPlugins()
        {
            log.Debug("--------- Adding plugin buttons");
            var q = HawkeyeApplication.Shell.PluginManager.Plugins.Where(p => p is ICommandPlugin).Cast <ICommandPlugin>().ToArray();

            if (q.Length == 0)
            {
                return;
            }

            var lastItemIndex = ToolStrip.Items.Count - 1; // This is the "Properties" button

            ToolStrip.Items.Insert(lastItemIndex, new ToolStripSeparator());

            foreach (var plugin in q)
            {
                var adapter = new CommandPluginAdapter(plugin);
                adapter.InsertToolStripButton(ToolStrip, lastItemIndex);
            }
        }
示例#2
0
        private void AddPlugins()
        {
            log.Debug("--------- Adding plugin buttons");
            var q = HawkeyeApplication.Shell.PluginManager.Plugins.Where(p => p is ICommandPlugin).Cast<ICommandPlugin>().ToArray();
            if (q.Length == 0) return;

            var lastItemIndex = ToolStrip.Items.Count - 1; // This is the "Properties" button
            ToolStrip.Items.Insert(lastItemIndex, new ToolStripSeparator());

            foreach (var plugin in q)
            {
                var adapter = new CommandPluginAdapter(plugin);
                adapter.InsertToolStripButton(ToolStrip, lastItemIndex);
            }
        }