public MenuItemViewModel AddMenuEntry(MenuID menuID) { MenuItemViewModel menuItem = new MenuItemViewModel() { ID = (int)menuID, Header = menuID.ToString(), }; Menu.AddOrUpdate(menuItem); return(menuItem); }
private void SwitchMenuPanel(MenuID newMenuName) { var newMenu = (Grid)FindName(newMenuName.ToString()); if (newMenu == null) { throw new KeyNotFoundException(String.Format("<{0}> Grid not found", newMenuName)); } if (currentMenu != null) { currentMenu.Visibility = Visibility.Collapsed; } currentMenu = newMenu; currentMenu.Visibility = Visibility.Visible; }
//set def position private void Start() { IUIScreenNavigationController[] uiNavigationControllerArray = gameObject.GetComponentsInChildren <IUIScreenNavigationController>(); for (int i = 0; i < uiNavigationControllerArray.Length; i++) { uiNavigationControllerArray[i].Source = gameObject; } RectTransform baseRectTransform = gameObject.GetComponent <RectTransform>(); if (baseRectTransform == null) { LoggingManager.AddErrorToLog("Didn't found RectTransform in menu " + MenuID.ToString()); } else { baseRectTransform.offsetMin = new Vector2(0, 0); baseRectTransform.offsetMax = new Vector2(0, 0); } }
public override void Save(StreamWriter ioStream) { // first part, the SUBMENU Script.ScriptSection weWrite = new Script.ScriptSection(); weWrite.SectionName = "SUBMENU " + MenuID; foreach (CreateItemEntry cie in SubItems) { weWrite.Add("ITEM", cie.MenuID.ToString()); } foreach (CreateMenuEntry cme in SubMenus) { weWrite.Add("MENU", cme.MenuID.ToString()); } weWrite.Save(ioStream); // second part, the MENUENTRY if (!isRoot) { Script.ScriptSection menuEntry = new Script.ScriptSection(); menuEntry.SectionName = "MENUENTRY " + MenuID; menuEntry.Add("NAME", name); menuEntry.Add("ID", Conversion.ToHexString(targID)); menuEntry.Add("COLOUR", Conversion.ToHexString(colour)); menuEntry.Add("SUBMENU", MenuID.ToString()); menuEntry.Save(ioStream); } foreach (CreateItemEntry cie2 in SubItems) { cie2.Save(ioStream); } foreach (CreateMenuEntry cme2 in SubMenus) { cme2.Save(ioStream); } }
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { hdfMaDonVi.Text = Session["MaDonVi"].ToString(); dfNgayTraThe.SelectedDate = DateTime.Now; dfNgayTraSo.SelectedDate = DateTime.Now; // add params for store Store1.BaseParams.Add(new Ext.Net.Parameter("uID", CurrentUser.ID.ToString())); Store1.BaseParams.Add(new Ext.Net.Parameter("mID", MenuID.ToString())); } // lọc theo phòng ban new DTH.BorderLayout() { menuID = MenuID, script = "#{hdfMaDonVi}.setValue('" + DTH.BorderLayout.nodeID + "');#{PagingToolbar1}.pageIndex = 0;#{DirectMethods}.SetValueQuery();" }.AddDepartmentList(brlayout, CurrentUser.ID, true); SetVisibleByControlID(btnThemNhanVien, btnCapNhatThuTuc, btnHuyThuTuc, pnlCongNoNhanVien, btnThemCongNo, pnlBanGiaoTaiSan); if (pnlBanGiaoTaiSan.Visible) { pnlBanGiaoTaiSan.Listeners.Activate.Handler = "if(hdfRecordID.getValue()!=Hidden1.getValue() && hdfRecordID.getValue()!=''){grpBanGiaoTaiSanStore.reload();Hidden1.setValue(hdfRecordID.getValue());}"; } if (pnlCongNoNhanVien.Visible) { pnlCongNoNhanVien.Listeners.Activate.Handler = "if(hdfRecordID.getValue()!=hdfLoadedEmployee.getValue() && hdfRecordID.getValue()!=''){grpCongNoNhanVienStore.reload();hdfLoadedEmployee.setValue(hdfRecordID.getValue());}"; } ucChooseEmployee1.AfterClickAcceptButton += new EventHandler(ucChooseEmployee1_AfterClickAcceptButton); }