Esempio n. 1
0
        private void Elem_Click(object sender, EventArgs e)
        {
            AccordionControlElement tooStripMenu = sender as AccordionControlElement;

            if (tooStripMenu == null)
            {
                return;
            }
            string tag = tooStripMenu.Tag as string;

            if (string.IsNullOrWhiteSpace(tag))
            {
                return;
            }
            //获取插件目录
            string Pluginspath = ConfigurationHelper.GetAppSettingOrDefault("PluginsPath", @"\plugins\");
            //获取插件对象
            IPlugIn plugIn = LoadPlugIn(Pluginspath + tag.Split(',')[1], tag.Split(',')[0]);

            if (plugIn == null)
            {
                MessageDxUtil.ShowError("未找到菜单配置的窗体实例,请检查窗体菜单配置。");
            }
            //创建子窗体并显示
            BaseForm plugInForm = plugIn.CreatePlugInForm();

            plugInForm.MdiParent = this;
            plugInForm.Show();
        }