/// <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); }
/// <summary> /// 打开或者新建工程时,初始化的结构计算按钮 /// 为了节省操作工程的时间,不初始下这个按钮的子菜单 /// </summary> /// <returns></returns> private ModuleMenu IniStruCalsModule() { ModuleMenu struCalsMudule = new ModuleMenu("StruCalsModule", this, "结构计算", (e) => { OnStruCalsModuleSeleced(e); }); struCalsMudule.SetIcon("FolderList_32x32.png"); return(struCalsMudule); }
/// <summary> /// 打开或者新建工程时,初始化的结构计算按钮 /// 为了节省操作工程的时间,不初始下这个按钮的子菜单 /// </summary> /// <returns></returns> private ModuleMenu IniTowerSequenceModule() { ModuleMenu towerSequenceMudule = new ModuleMenu("TowerSequenceModule", this, "杆塔序列", (e) => { OnTowerSequenceModuleSeleced(e); }); towerSequenceMudule.SetIcon("FolderList_32x32.png"); return(towerSequenceMudule); }
/// <summary> /// 打开或者新建工程时,初始化的结构计算按钮 /// 为了节省操作工程的时间,不初始下这个按钮的子菜单 /// </summary> /// <returns></returns> private ModuleMenu IniElectricalCalsModule() { ElectricalCalsMenu = new ModuleMenu("ElecCalsModule", this, "电气计算", (e) => { OnSelectedModuleChanged(e); }); ElectricalCalsMenu.SetIcon("FolderList_32x32.png"); //左侧基础菜单列表 var menuItem = new List <SubMenuBase>() { }; GetElectricalCalsMenuList(menuItem); ElectricalCalsMenu.MenuItems = menuItem; return(ElectricalCalsMenu); }
private ModuleMenu IniBaseDataModule() { ModuleMenu baseDataMudule = new ModuleMenu("BaseDataModule", this, "基础数据", (e) => { OnSelectedModuleChanged(e); }); baseDataMudule.SetIcon("FolderList_32x32.png"); //左侧基础菜单列表 var menuItem = new List <SubMenuBase>() { }; GetMenuList(menuItem); baseDataMudule.MenuItems = menuItem; return(baseDataMudule); }
void CloseProject() { SaveCurrentModule(); Modules = new List <ModuleMenu>(); MenuItems = new ObservableCollection <SubMenuBase>(); NewStruCalsTowerBtnVisibity = Visibility.Collapsed; NewTowerSequenceTowerBtnVisibity = Visibility.Collapsed; ModuleMenu blankModule = new ModuleMenu("BlankModule", this, "空模板", (e) => { OnSelectedModuleChanged(e); }); blankModule.Show(); }
/// <summary> /// 点击结构计算按钮时的操作 /// </summary> /// <param name="mv"></param> private void OnStruCalsModuleSeleced(ModuleMenu mv) { NewStruCalsTowerBtnVisibity = Visibility.Visible; NewTowerSequenceTowerBtnVisibity = Visibility.Collapsed; //清除以前的结构计算模块下的子菜单, if (mv.MenuItems != null) { mv.MenuItems.Clear(); } //根据当前铁塔序列加载其下所选择的塔位或者单独增加的塔位 LaodTowerSubMenu(_curTowerSeqence == "" ? true :false, mv); StruCalsTowerSingleBtnVisibity = _curTowerSeqence == "" ? Visibility.Visible : Visibility.Collapsed; StruCalsTowerSerialBtnVisibity = _curTowerSeqence != "" ? Visibility.Visible : Visibility.Collapsed; }
protected void LaodTowerSubMenu(bool isSingle, ModuleMenu mv) { var menuItems = new List <SubMenuBase>() { }; var towers = isSingle ? projectUtils.GetAllStrucTowerNames() : GlobalInfo.GetInstance().GetSelecedTowerNamesInSequence(_curTowerSeqence); string seq = isSingle ? "" : _curTowerSeqence; foreach (var tower in towers) { StrCalsModuleSubMenu menu = new StrCalsModuleSubMenu("", this, tower, seq, (e) => { OnSelectedStruCalsTowersChanged(e); }); AddStruClasTowerSubMenu(menu); menuItems.Add(menu); } mv.MenuItems = menuItems; MenuItems = new ObservableCollection <SubMenuBase>(SelectedModuleInfo.MenuItems); }
private void OnSelectedModuleChanged(ModuleMenu mv) { NewStruCalsTowerBtnVisibity = (mv != null && mv.Title == "结构计算") ? Visibility.Visible : Visibility.Collapsed; NewTowerSequenceTowerBtnVisibity = (mv != null && mv.Title == "杆塔序列") ? Visibility.Visible : Visibility.Collapsed; }