예제 #1
0
        private void AddSubMenu(SinoMenuItem _fmenuitem, List <SinoMenuItem> _menuList, FrmMenuPage _fmp)
        {
            SinoMenuFatherFinder _finder      = new SinoMenuFatherFinder(_fmenuitem.MenuID);
            List <SinoMenuItem>  _subMenuList = _menuList.FindAll(new Predicate <SinoMenuItem>(_finder.FindByFather));

            _subMenuList.Sort(new SinoMenuComparer());
            foreach (SinoMenuItem _smi in _subMenuList)
            {
                FrmMenuGroup _fmg = new FrmMenuGroup(_smi.MenuID, _smi.MenuTitle, _smi.CanUse);
                this.AddMenuGroup(_fmp, _fmg);
                if (_smi.MenuType != "")
                {
                    MenuTypeBase   _mtype        = MenuTypeCreator.CreateMenuType(_smi.MenuType);
                    IPluginService pluginService = (IPluginService)application.GetService(typeof(IPluginService));
                    IPlugin        _plugin       = pluginService.GetPluginInstance(_mtype.MenuTypePluginName);
                    if (_plugin == null)
                    {
                        RaiseLoadErrord(new CommonEventArgs(string.Format("未找到组菜单定义:{0}", _mtype)));
                    }
                    else
                    {
                        _plugin.Load(_fmg, _smi.MenuParameter);
                    }
                }
                else
                {
                    this.AddSubMenuItem(_smi, _menuList, _fmg);
                }
            }
        }
예제 #2
0
 private void TE_MenuType_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (_initFinished)
     {
         string       _menutype = this.TE_MenuType.SelectedItem as string;
         MenuTypeBase _menu     = MenuTypeCreator.CreateMenuType(_menutype);
         this.TE_CS.EditValue = _menu.MenuTypeParameters;
     }
     this._haveChange = true;
     RaiseDataChanged();
 }