/// <summary> /// 点击杆塔序列按钮时的操作 /// </summary> /// <param name="mv"></param> private void OnTowerSequenceModuleSeleced(ModuleMenu mv) { NewTowerSequenceTowerBtnVisibity = Visibility.Visible; NewStruCalsTowerBtnVisibity = Visibility.Collapsed; //以前没有加载过子菜单,从配置文件中读出所有塔位名称 if (mv.MenuItems == null || mv.MenuItems.Count() == 0) { var menuItems = new List <SubMenuBase>() { }; var menuList = projectUtils.GetAllTowerSequenceNames(); foreach (var name in menuList) { SubMenuBase menu = new SubMenuBase("TowerSequenceModule", this, name, (e) => { OnSelectedTowerSequenceChanged(e); }); menu.SetIcon("Menu_weather.png"); menuItems.Add(menu); } mv.MenuItems = menuItems; } MenuItems = new ObservableCollection <SubMenuBase>(SelectedModuleInfo.MenuItems); }
public void AddTowerSequenceWindowClosed(object sender, string newSequenceName) { AddTowerSequenceViewModel model = (AddTowerSequenceViewModel)sender; model.CloseWindowEvent -= AddTowerSequenceWindowClosed; if (addTowerSequenceWindow != null) { addTowerSequenceWindow.Close(); } addTowerSequenceWindow = null; if (newSequenceName == null || newSequenceName == "") { return; } SubMenuBase newSequenceMenu = new SubMenuBase("TowerSequenceModule", this, newSequenceName, (e) => { OnSelectedTowerSequenceChanged(e); }); newSequenceMenu.SetIcon("Menu_weather.png"); SelectedModuleInfo.MenuItems.Add(newSequenceMenu); MenuItems = new ObservableCollection <SubMenuBase>(SelectedModuleInfo.MenuItems); //电气计算同步增加菜单 var subMenu = new SubMenuBase("ElectricalCheckingParModule", this, " " + newSequenceName, (e) => { OnSelectedBaseDataSubModuleChanged(e); }); subMenu.ParentNode = ElectricalCalsMenu.MenuItems[0]; var subList = new List <SubMenuBase>() { }; var subMenu1 = new SubMenuBase("", this, " 悬垂塔", (e) => { OnSelectedSubModuleItemChanged(e); }); subMenu1.ParentNode = subMenu; subList.Add(subMenu1); var subMenu2 = new SubMenuBase("", this, " 耐张塔", (e) => { OnSelectedSubModuleItemChanged(e); }); subMenu2.ParentNode = subMenu; subList.Add(subMenu2); subMenu.ChildItems = subList; ElectricalCalsMenu.MenuItems[0].ChildItems.Add(subMenu); }
/// <summary> /// 菜单列表 /// </summary> /// <param name="menuItem"></param> private void GetMenuList(List <SubMenuBase> menuItem) { var towerMenu = new SubMenuBase("TowerModule", this, "杆塔使用条件", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); towerMenu.SetIcon("Menu_tower.png"); menuItem.Add(towerMenu); var configureMenu = new SubMenuBase("TowerStructureConfigureModule", this, "杆塔结构配置", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); configureMenu.SetIcon("Menu_tower.png"); menuItem.Add(configureMenu); var weatherMenu = new SubMenuBase("WeatherConditionModule", this, "气象条件", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); weatherMenu.SetIcon("Menu_weather.png"); menuItem.Add(weatherMenu); var wireMenu = new SubMenuBase("WireModule", this, "导地线", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); wireMenu.SetIcon("Menu_wire.png"); var wireSubList = new List <SubMenuBase>() { }; var wireSubMenu1 = new SubMenuBase("", this, " 导线", (e) => { OnSelectedSubModuleItemChanged(e); }); wireSubMenu1.ParentNode = wireMenu; wireSubList.Add(wireSubMenu1); var wireSubMenu2 = new SubMenuBase("", this, " 地线", (e) => { OnSelectedSubModuleItemChanged(e); }); wireSubMenu2.ParentNode = wireMenu; wireSubList.Add(wireSubMenu2); wireMenu.ChildItems = wireSubList; menuItem.Add(wireMenu); var strDataMenu = new SubMenuBase("StrDataModule", this, "绝缘子串", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); strDataMenu.SetIcon("Menu_subString.png"); var strDataSubList = new List <SubMenuBase>() { }; var strDataSubMenu1 = new SubMenuBase("", this, " 一般子串", (e) => { OnSelectedSubModuleItemChanged(e); }); strDataSubMenu1.ParentNode = strDataMenu; strDataSubList.Add(strDataSubMenu1); var strDataSubMenu2 = new SubMenuBase("", this, " 硬跳线", (e) => { OnSelectedSubModuleItemChanged(e); }); strDataSubMenu2.ParentNode = strDataMenu; strDataSubList.Add(strDataSubMenu2); strDataMenu.ChildItems = strDataSubList; menuItem.Add(strDataMenu); var fitDataMenu = new SubMenuBase("FitDataModule", this, "其他金具", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); fitDataMenu.SetIcon("Menu_tool.png"); var fitDataSubList = new List <SubMenuBase>() { }; var fitDataSubMenu1 = new SubMenuBase("", this, " 防震锤", (e) => { OnSelectedSubModuleItemChanged(e); }); fitDataSubMenu1.ParentNode = fitDataMenu; fitDataSubList.Add(fitDataSubMenu1); var fitDataSubMenu2 = new SubMenuBase("", this, " 间隔棒", (e) => { OnSelectedSubModuleItemChanged(e); }); fitDataSubMenu2.ParentNode = fitDataMenu; fitDataSubList.Add(fitDataSubMenu2); var fitDataSubMenu3 = new SubMenuBase("", this, " 警示装置", (e) => { OnSelectedSubModuleItemChanged(e); }); fitDataSubMenu3.ParentNode = fitDataMenu; fitDataSubList.Add(fitDataSubMenu3); var fitDataSubMenu4 = new SubMenuBase("", this, " 其他装置", (e) => { OnSelectedSubModuleItemChanged(e); }); fitDataSubMenu4.ParentNode = fitDataMenu; fitDataSubList.Add(fitDataSubMenu4); fitDataMenu.ChildItems = fitDataSubList; menuItem.Add(fitDataMenu); var electricalLibMenu = new SubMenuBase("", this, "电气计算库", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); electricalLibMenu.SetIcon("Menu_para.png"); var electricalLibSubList = new List <SubMenuBase>() { }; var electricalBaseDataMenu = new SubMenuBase("BaseDataTemplateModule", this, " 不均匀冰断线参数", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); electricalBaseDataMenu.ParentNode = electricalLibMenu; electricalLibSubList.Add(electricalBaseDataMenu); electricalLibMenu.ChildItems = electricalLibSubList; menuItem.Add(electricalLibMenu); var struCalsLibMenu = new SubMenuBase("", this, "结构计算库", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); struCalsLibMenu.SetIcon("Menu_para.png"); var struCalsLibSubList = new List <SubMenuBase>() { }; var baseDataLibMenu = new SubMenuBase("StruCalsLibBaseDataModule", this, " 基本参数库", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); baseDataLibMenu.ParentNode = struCalsLibMenu; struCalsLibSubList.Add(baseDataLibMenu); var extralLoadLibMenu = new SubMenuBase("StruCalsLibExtralLoadModule", this, " 附加荷载库", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); extralLoadLibMenu.ParentNode = struCalsLibMenu; struCalsLibSubList.Add(extralLoadLibMenu); var IceCoverLibModule = new SubMenuBase("StruCalsLibIceCoverModule", this, " 覆冰参数库", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); IceCoverLibModule.ParentNode = struCalsLibMenu; struCalsLibSubList.Add(IceCoverLibModule); struCalsLibMenu.ChildItems = struCalsLibSubList; menuItem.Add(struCalsLibMenu); var struTemplateLibMenu = new SubMenuBase("", this, "结构模板库", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); struTemplateLibMenu.SetIcon("Menu_para.png"); var struTemplateLibSubList = new List <SubMenuBase>() { }; var generalTemplateLibMenu = new SubMenuBase("StruTemplateLibGeneralModule", this, " 通用模板库", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); generalTemplateLibMenu.ParentNode = struTemplateLibMenu; struTemplateLibSubList.Add(generalTemplateLibMenu); var projectTemplateLibMenu = new SubMenuBase("StruTemplateLibProjectModule", this, " 工程模板库", (e) => { OnSelectedBaseDataSubModuleChanged(e); }); projectTemplateLibMenu.ParentNode = struTemplateLibMenu; struTemplateLibSubList.Add(projectTemplateLibMenu); struTemplateLibMenu.ChildItems = struTemplateLibSubList; menuItem.Add(struTemplateLibMenu); }
/// <summary> /// 右侧网络连接菜单列表 /// </summary> /// <param name="menuItem"></param> private void GetRightMenuList(List <SubMenuBase> menuItem) { var weatherMenu = new SubMenuBase("WeatherConditionModule_Internet", this, "气象条件", (e) => { OnSelectedMenuChanged(e); }); weatherMenu.SetIcon("Menu_weather.png"); menuItem.Add(weatherMenu); var wireMenu = new SubMenuBase("", this, "导地线", (e) => { OnSelectedMenuChanged(e); }); wireMenu.SetIcon("Menu_wire.png"); var wireSubList = new List <SubMenuBase>() { }; var wireSubMenu1 = new SubMenuBase("WireModule_Internet", this, " 导线", (e) => { OnSelectedMenuChanged(e); }); wireSubMenu1.ParentNode = wireMenu; wireSubList.Add(wireSubMenu1); var wireSubMenu2 = new SubMenuBase("EarthWireModule_Internet", this, " 地线", (e) => { OnSelectedMenuChanged(e); }); wireSubMenu2.ParentNode = wireMenu; wireSubList.Add(wireSubMenu2); wireMenu.ChildItems = wireSubList; menuItem.Add(wireMenu); var strDataMenu = new SubMenuBase("", this, "绝缘子串", (e) => { OnSelectedMenuChanged(e); }); strDataMenu.SetIcon("Menu_subString.png"); var strDataSubList = new List <SubMenuBase>() { }; var strDataSubMenu1 = new SubMenuBase("GeneralInsulatorModule", this, " 一般串", (e) => { OnSelectedMenuChanged(e); }); strDataSubMenu1.ParentNode = strDataMenu; strDataSubList.Add(strDataSubMenu1); var strDataSubMenu2 = new SubMenuBase("RigidJumperInsulatorModule", this, " 硬跳线", (e) => { OnSelectedMenuChanged(e); }); strDataSubMenu2.ParentNode = strDataMenu; strDataSubList.Add(strDataSubMenu2); strDataMenu.ChildItems = strDataSubList; menuItem.Add(strDataMenu); var fitDataMenu = new SubMenuBase("", this, "其他金具", (e) => { OnSelectedMenuChanged(e); }); fitDataMenu.SetIcon("Menu_tool.png"); var fitDataSubList = new List <SubMenuBase>() { }; var fitDataSubMenu1 = new SubMenuBase("CounterWeightModule", this, " 防震锤", (e) => { OnSelectedMenuChanged(e); }); fitDataSubMenu1.ParentNode = fitDataMenu; fitDataSubList.Add(fitDataSubMenu1); var fitDataSubMenu2 = new SubMenuBase("SpacerModule", this, " 间隔棒", (e) => { OnSelectedMenuChanged(e); }); fitDataSubMenu2.ParentNode = fitDataMenu; fitDataSubList.Add(fitDataSubMenu2); fitDataMenu.ChildItems = fitDataSubList; menuItem.Add(fitDataMenu); var struCalsLibMenu = new SubMenuBase("", this, "结构计算库", (e) => { OnSelectedMenuChanged(e); }); struCalsLibMenu.SetIcon("Menu_para.png"); var struCalsLibSubList = new List <SubMenuBase>() { }; var baseDataLibMenu = new SubMenuBase("StruCalsLibBaseDataModule_Internet", this, " 基本参数库", (e) => { OnSelectedMenuChanged(e); }); baseDataLibMenu.ParentNode = struCalsLibMenu; struCalsLibSubList.Add(baseDataLibMenu); var extralLoadLibMenu = new SubMenuBase("StruCalsLibExtralLoadModule_Internet", this, " 附加荷载库", (e) => { OnSelectedMenuChanged(e); }); extralLoadLibMenu.ParentNode = struCalsLibMenu; struCalsLibSubList.Add(extralLoadLibMenu); var IceCoverLibModule = new SubMenuBase("StruCalsLibIceCoverModule_Internet", this, " 覆冰参数库", (e) => { OnSelectedMenuChanged(e); }); IceCoverLibModule.ParentNode = struCalsLibMenu; struCalsLibSubList.Add(IceCoverLibModule); struCalsLibMenu.ChildItems = struCalsLibSubList; menuItem.Add(struCalsLibMenu); var struTemplateLibMenu = new SubMenuBase("", this, "结构模板库", (e) => { OnSelectedMenuChanged(e); }); struTemplateLibMenu.SetIcon("Menu_para.png"); var struTemplateLibSubList = new List <SubMenuBase>() { }; var generalTemplateLibMenu = new SubMenuBase("StruTemplateLibGeneralModule_Internet", this, " 通用模板库", (e) => { OnSelectedMenuChanged(e); }); generalTemplateLibMenu.ParentNode = struTemplateLibMenu; struTemplateLibSubList.Add(generalTemplateLibMenu); //var test = new SubMenuBase("ElectricalCommonParModule", this, " 共同参数", (e) => { OnSelectedMenuChanged(e); }); //test.ParentNode = struTemplateLibMenu; //struTemplateLibSubList.Add(test); //var test1 = new SubMenuBase("ElectricalSideParModule", this, " 单侧参数", (e) => { OnSelectedMenuChanged(e); }); //test1.ParentNode = struTemplateLibMenu; //struTemplateLibSubList.Add(test1); struTemplateLibMenu.ChildItems = struTemplateLibSubList; menuItem.Add(struTemplateLibMenu); }