private void InitNavigation(string controller) { var navigation = new NavItem<NavUrl>(); navigation.AddGroup("Meso. Wind DB", isActive: controller == "MesoWind") .AddItem("Database", new NavUrl("Database", "MesoWind", "EngineeringTools")) .AddItem("Help", new NavUrl("Index", "EngMesoWind", "Help"), openInNewWindow: true); /* .AddItem("Current Data", new NavUrl("CurrentData", "MesoWind", "EngineeringTools")) .AddItem("Velocity Freq.", new NavUrl("VelocityFreq", "MesoWind", "EngineeringTools")) .AddItem("Wind Rose", new NavUrl("WindRose", "MesoWind", "EngineeringTools")); */ navigation.AddGroup("Power Calculator", isActive: controller == "WindWave") .AddItem("Input Data", new NavUrl("InputData", "WindWave", "EngineeringTools")) .AddItem("Power Output", new NavUrl("PowerOutput", "WindWave", "EngineeringTools")) .AddItem("Power Output Adv.", new NavUrl("PowerOutputAdvanced", "WindWave", "EngineeringTools")) .AddItem("Help", new NavUrl("Index", "EngPowerCalc", "Help"), openInNewWindow: true); navigation.AddGroup("Wake Simulation", isActive: controller == "WakeSimulation") .AddItem("General Properties", new NavUrl("GeneralProperties", "WakeSimulation", "EngineeringTools")) .AddItem("Turbine Coordinates", new NavUrl("TurbineCoordinates", "WakeSimulation", "EngineeringTools")) .AddItem("Simulation", new NavUrl("Simulation", "WakeSimulation", "EngineeringTools")) .AddItem("Post-processing", new NavUrl("PostProcessing", "WakeSimulation", "EngineeringTools")) .AddItem("Help", new NavUrl("Index", "EngWindSim", "Help"), openInNewWindow: true); navigation.AddGroup("Wind Farm Control", isActive: controller == "WakeSimulation2") .AddItem("Simulation", new NavUrl("Simulation", "WakeSimulation2", "EngineeringTools")) .AddItem("Results", new NavUrl("Results", "WakeSimulation2", "EngineeringTools")) .AddItem("Help", new NavUrl("Index", "EngWindSim", "Help"), openInNewWindow: true); //navigation.AddGroup("Wind Farm Control", isActive: controller == "WindFarm") // .AddItem("Input Data", new NavUrl("InputData", "WindFarm", "EngineeringTools")) // .AddItem("Simulation", new NavUrl("Simulation", "WindFarm", "EngineeringTools")); ViewBag.SideNav = navigation; }
private void InitNavigation() { var navigation = new NavItem<NavUrl>(); //navigation.AddGroup("") // .AddItem("Overview", new NavUrl("Index", "MesoWind", "EngineeringTools")) // .AddItem("Database", new NavUrl("Database", "MesoWind", "EngineeringTools")); ///* // .AddItem("Current Data", new NavUrl("CurrentData", "MesoWind", "EngineeringTools")) // .AddItem("Velocity Freq.", new NavUrl("VelocityFreq", "MesoWind", "EngineeringTools")) // .AddItem("Wind Rose", new NavUrl("WindRose", "MesoWind", "EngineeringTools")); //*/ //navigation.AddGroup("Wake Simulation") // .AddItem("General Properties", new NavUrl("GeneralProperties", "WakeSimulation", "EngineeringTools")) // .AddItem("Turbine Coordinates", new NavUrl("TurbineCoordinates", "WakeSimulation", "EngineeringTools")) // .AddItem("Simulation", new NavUrl("Simulation", "WakeSimulation", "EngineeringTools")) // .AddItem("Post-processing", new NavUrl("PostProcessing", "WakeSimulation", "EngineeringTools")); //navigation.AddGroup("Wind Wave Power") // .AddItem("Overview", new NavUrl("Index", "WindWave", "EngineeringTools")) // .AddItem("Input Data", new NavUrl("InputData", "WindWave", "EngineeringTools")) // .AddItem("Power Output", new NavUrl("PowerOutput", "WindWave", "EngineeringTools")) // .AddItem("Power Output Adv.", new NavUrl("PowerOutputAdvanced", "WindWave", "EngineeringTools")); //navigation.AddGroup("Wind Farm Control") // .AddItem("Input Data", new NavUrl("InputData", "WindFarm", "EngineeringTools")) // .AddItem("Simulation", new NavUrl("Simulation", "WindFarm", "EngineeringTools")); //foreach (var grp in navigation) //{ // grp.IsActive = grp.Title == _currentGroup; //} ViewBag.SideNav = navigation; }
public string GetSelectedText(NavItem item) { int i = (int)item; if (i < 0 || i >= _dropDownLists.Length) return string.Empty; return _dropDownLists[i].SelectedItem.Text; }
private void InitNavigation() { var navigation = new NavItem<NavUrl>(); navigation.AddGroup("Wind Farms & Turbines") .AddItem("Overview", new NavUrl("Index", "HomeWindFarms", "WindFarms")) .AddItem("Wind Farms", new NavUrl("List", "WindFarm", "WindFarms")) .AddItem("Turbines", new NavUrl("List", "Turbine", "WindFarms")); foreach (var grp in navigation) { grp.IsActive = grp.Title == _currentGroup; } ViewBag.SideNav = navigation; }
private void InitNavigation() { var navigation = new NavItem<string>(); var group = navigation.AddGroup("Information"); var cid = Guid.Parse("9EC610BF-4F5B-4E02-A3DA-DA6C853F9B64"); foreach (var ri in _ctx.VRouteItems.Where(ri => ri.CategoryId == cid).OrderBy(ri => ri.Position)) { group.AddItem(ri.RouteTitle, ri.Route); } foreach (var grp in navigation) { grp.IsActive = true; } ViewBag.SideNav = navigation; }
protected override void OnActionExecuted(ActionExecutedContext filterContext) { var navigation = new NavItem <NavUrl>(); navigation.AddGroup("Content") .AddItem("Block", new NavUrl("Index", "ContentMgmt", "ControlPanel", ContentType.Block.S())) .AddItem("Blog", new NavUrl("Index", "ContentMgmt", "ControlPanel", ContentType.Blog.S())) .AddItem("Page", new NavUrl("Index", "ContentMgmt", "ControlPanel", ContentType.Page.S())); navigation.AddGroup("Users") .AddItem("Users", new NavUrl("Index", "Users", "ControlPanel")); //ViewBag.SideNav = navigation; ViewBag.IsAdmin = AccountsHelper.IsAdmin(filterContext.HttpContext.User.Identity.Name); base.OnActionExecuted(filterContext); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public override ArcSegmentSettings GetArcSegmentSettings(NavItem pNavItem) { var sett = new ArcSegmentSettings(); sett.TextSize = TextSize; sett.TextColor = TextColor; sett.TextFont = TextFont; sett.ArrowIconColor = ArrowIconColor; sett.ToggleIconColor = ToggleIconColor; sett.BackgroundColor = BackgroundColor; sett.EdgeColor = EdgeColor; sett.HighlightColor = HighlightColor; sett.SelectionColor = SelectionColor; sett.SliderTrackColor = SliderTrackColor; sett.SliderFillColor = SliderFillColor; sett.SliderTickColor = SliderTickColor; return(sett); }
public GithubAuthProvider(IAppSettings appSettings) : base(appSettings, Realm, Name, "ClientId", "ClientSecret") { ClientId = appSettings.GetString("oauth.github.ClientId"); ClientSecret = appSettings.GetString("oauth.github.ClientSecret"); Scopes = appSettings.Get("oauth.github.Scopes", new[] { "user" }); PreAuthUrl = DefaultPreAuthUrl; VerifyAccessTokenUrl = DefaultVerifyAccessTokenUrl; ClientConfig.ConfigureTls12(); NavItem = new NavItem { Href = "/auth/" + Name, Label = "Sign In with GitHub", Id = "btn-" + Name, ClassName = "btn-social btn-github", IconClass = "fab svg-github", }; }
protected override void OnActionExecuted(ActionExecutedContext filterContext) { var navigation = new NavItem<NavUrl>(); navigation.AddGroup("Content") .AddItem("Block", new NavUrl("Index", "ContentMgmt", "ControlPanel", ContentType.Block.S())) .AddItem("Blog", new NavUrl("Index", "ContentMgmt", "ControlPanel", ContentType.Blog.S())) .AddItem("Page", new NavUrl("Index", "ContentMgmt", "ControlPanel", ContentType.Page.S())); navigation.AddGroup("Users") .AddItem("Users", new NavUrl("Index", "Users", "ControlPanel")); //ViewBag.SideNav = navigation; ViewBag.IsAdmin = AccountsHelper.IsAdmin(filterContext.HttpContext.User.Identity.Name); base.OnActionExecuted(filterContext); }
public ActionResult DeleteConfirmed(int id, bool isGroup) { if (isGroup) { NavGroup group = _navGroupRepo.Get(id); RemoveAllChildren(group); } else { NavItem item = _navItemRepo.Get(id); _navItemRepo.Delete(item); } // Transaction problem? _navItemRepo.Save(); _navGroupRepo.Save(); return(RedirectToAction("Index")); }
void ReleaseDesignerOutlets() { if (AddBarButton != null) { AddBarButton.Dispose(); AddBarButton = null; } if (CancelBarButton != null) { CancelBarButton.Dispose(); CancelBarButton = null; } if (MainView != null) { MainView.Dispose(); MainView = null; } if (NavItem != null) { NavItem.Dispose(); NavItem = null; } if (OverlayView != null) { OverlayView.Dispose(); OverlayView = null; } if (TableView != null) { TableView.Dispose(); TableView = null; } if (AccountSwitchingBarButton != null) { AccountSwitchingBarButton.Dispose(); AccountSwitchingBarButton = null; } }
private void InitNavigation() { var navigation = new NavItem<NavUrl>(); navigation.AddGroup("Pre-processing") .AddItem("Domain Setup", new NavUrl("DomainSetup", "Preprocessing", "CFD")) .AddItem("Transport Properties", new NavUrl("TransportProperties", "Preprocessing", "CFD")) .AddItem("Earth STL Generator", new NavUrl("StlGenerator", "Preprocessing", "CFD")); navigation.AddGroup("Boundary Conditions") .AddItem("k", new NavUrl("FieldK", "BoundaryConditions", "CFD")) .AddItem("epsilon", new NavUrl("FieldEpsilon", "BoundaryConditions", "CFD")) .AddItem("p", new NavUrl("FieldP", "BoundaryConditions", "CFD")) .AddItem("R", new NavUrl("FieldR", "BoundaryConditions", "CFD")) .AddItem("U", new NavUrl("FieldU", "BoundaryConditions", "CFD")); navigation.AddGroup("Turbines") .AddItem("Turbine Types", new NavUrl("TurbineTypes", "Turbines", "CFD")) .AddItem("Turbine Array", new NavUrl("TurbineArray", "Turbines", "CFD")); navigation.AddGroup("Airfoil & Turbulence") .AddItem("Airfoil Properties", new NavUrl("AirfoilProperties", "AirfoilAndTurbulence", "CFD")) .AddItem("Turbulence Properties", new NavUrl("TurbulenceProperties", "AirfoilAndTurbulence", "CFD")); navigation.AddGroup("System") .AddItem("Time", new NavUrl("Time", "SystemControls", "CFD")) .AddItem("Schemes", new NavUrl("Schemes", "SystemControls", "CFD")) .AddItem("Solution", new NavUrl("Solution", "SystemControls", "CFD")) .AddItem("ParallelExecution", new NavUrl("ParallelExecution", "SystemControls", "CFD")); navigation.AddGroup("Processing") .AddItem("Settings", new NavUrl("Settings", "Processing", "CFD")) .AddItem("Simulation", new NavUrl("Simulation", "Processing", "CFD")) .AddItem("History", new NavUrl("History", "Processing", "CFD")); navigation.AddGroup("Case Management") .AddItem("Reset", new NavUrl("Reset", "CaseManagement", "CFD")); foreach (var grp in navigation) { grp.IsActive = grp.Title == SectionTitle; } ViewBag.SideNav = navigation; }
public List <NavGrouping> CreateAuctionNavList(List <String> destNames) { List <NavGrouping> navList = new List <NavGrouping>(); NavGrouping grouping = new NavGrouping(); grouping.GroupingHeader = "Auctions"; NavItem navItem = new NavItem(); navItem.Destination = "/auctions/"; navItem.DestinationName = openDestName; navItem.SetSelected(destNames); grouping.NavItems.Add(navItem); navItem = new NavItem(); navItem.Destination = "/auctions/closed"; navItem.DestinationName = closedDestName; navItem.SetSelected(destNames); grouping.NavItems.Add(navItem); navItem = new NavItem(); navItem.Destination = "/auctions/mywinningbids"; navItem.DestinationName = mywinningDestName; navItem.SetSelected(destNames); grouping.NavItems.Add(navItem); navItem = new NavItem(); navItem.Destination = "/auctions/mycurrentbids"; navItem.DestinationName = livebidsDestName; navItem.SetSelected(destNames); grouping.NavItems.Add(navItem); navItem = new NavItem(); navItem.Destination = "/auctions/mybidhistory"; navItem.DestinationName = allbidsDestName; navItem.SetSelected(destNames); grouping.NavItems.Add(navItem); navItem = new NavItem(); navItem.Destination = "/auctions/myauctions"; navItem.DestinationName = myaucsDestName; navItem.SetSelected(destNames); grouping.NavItems.Add(navItem); navList.Add(grouping); return(navList); }
public GithubAuthProvider(IAppSettings appSettings) : base(appSettings, Realm, Name, "ClientId", "ClientSecret") { ClientId = appSettings.GetString("oauth.github.ClientId"); ClientSecret = appSettings.GetString("oauth.github.ClientSecret"); Scopes = appSettings.Get("oauth.github.Scopes", new[] { "user" }); PreAuthUrl = DefaultPreAuthUrl; VerifyAccessTokenUrl = DefaultVerifyAccessTokenUrl; ClientConfig.ConfigureTls12(); Icon = Svg.ImageSvg("<svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 20 20'><path fill-rule='evenodd' d='M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z' clip-rule='evenodd' /></svg>"); NavItem = new NavItem { Href = "/auth/" + Name, Label = "Sign In with GitHub", Id = "btn-" + Name, ClassName = "btn-social btn-github", IconClass = "fab svg-github", }; }
private void InitNavigation(string controller) { var navigation = new NavItem <NavUrl>(); navigation.AddGroup("Meso. Wind DB", isActive: controller == "MesoWind") .AddItem("Database", new NavUrl("Database", "MesoWind", "EngineeringTools")) .AddItem("Help", new NavUrl("Index", "EngMesoWind", "Help"), openInNewWindow: true); /* * .AddItem("Current Data", new NavUrl("CurrentData", "MesoWind", "EngineeringTools")) * .AddItem("Velocity Freq.", new NavUrl("VelocityFreq", "MesoWind", "EngineeringTools")) * .AddItem("Wind Rose", new NavUrl("WindRose", "MesoWind", "EngineeringTools")); */ navigation.AddGroup("Power Calculator", isActive: controller == "WindWave") .AddItem("Input Data", new NavUrl("InputData", "WindWave", "EngineeringTools")) .AddItem("Power Output", new NavUrl("PowerOutput", "WindWave", "EngineeringTools")) .AddItem("Power Output Adv.", new NavUrl("PowerOutputAdvanced", "WindWave", "EngineeringTools")) .AddItem("Help", new NavUrl("Index", "EngPowerCalc", "Help"), openInNewWindow: true); navigation.AddGroup("Wake Simulation", isActive: controller == "WakeSimulation") .AddItem("General Properties", new NavUrl("GeneralProperties", "WakeSimulation", "EngineeringTools")) .AddItem("Turbine Coordinates", new NavUrl("TurbineCoordinates", "WakeSimulation", "EngineeringTools")) .AddItem("Simulation", new NavUrl("Simulation", "WakeSimulation", "EngineeringTools")) .AddItem("Post-processing", new NavUrl("PostProcessing", "WakeSimulation", "EngineeringTools")) .AddItem("Help", new NavUrl("Index", "EngWindSim", "Help"), openInNewWindow: true); navigation.AddGroup("Wind Farm Control", isActive: controller == "WakeSimulation2") .AddItem("Simulation", new NavUrl("Simulation", "WakeSimulation2", "EngineeringTools")) .AddItem("Results", new NavUrl("Results", "WakeSimulation2", "EngineeringTools")) .AddItem("Help", new NavUrl("Index", "EngWindSim", "Help"), openInNewWindow: true); navigation.AddGroup("Wind Farm Control-N", isActive: controller == "WakeSimulation2New") .AddItem("Simulation", new NavUrl("Simulation", "WakeSimulation2New", "EngineeringTools")) .AddItem("Results", new NavUrl("Results", "WakeSimulation2New", "EngineeringTools")) .AddItem("Nowcasting", new NavUrl("Nowcasting", "WakeSimulation2New", "EngineeringTools")) .AddItem("Help", new NavUrl("Index", "EngWindFarmControlNew", "Help"), openInNewWindow: true); //navigation.AddGroup("Wind Farm Control", isActive: controller == "WindFarm") // .AddItem("Input Data", new NavUrl("InputData", "WindFarm", "EngineeringTools")) // .AddItem("Simulation", new NavUrl("Simulation", "WindFarm", "EngineeringTools")); ViewBag.SideNav = navigation; }
// // GET: /Navigation/ /// <summary> /// Render primary navigation, including top level items and optionally also with first level of children underneath. /// This can be used for top navigation with dropdown menus. /// </summary> public ActionResult MainNav(string sectionCode, Page currentPage, bool includeChildren) { var data = new NavViewModel(); sectionCode = sectionCode + ""; data.SectionCode = sectionCode; var sql = new Sql("where ShowInMainNav=1 and ParentPageID is null"); sql.AndIsActive <Page>(); //var pages = PageList.Load(sql); var pages = PageCache.MainNav; foreach (var page in pages) { var item = new NavItem(page); if (page.ID == currentPage.SectionPageID) { item.IsSelected = true; //} else if (page.PageCode.IsNotBlank() && page.PageCode.ToLower()==sectionCode.ToLower()) { // item.IsSelected = true; } if (page.LinkUrlIsExternal) { item.IsExternalUrl = true; } if (includeChildren) { item.SubPages = GetChildren(page, sectionCode); } data.NavItems.Add(item); } // set css classes int selectedItemIndex = data.NavItems.FindIndex(item => item.IsSelected); if (selectedItemIndex > -1) { data.NavItems[selectedItemIndex].CssClass = "active"; } data.CurrentPageID = currentPage.ID; return(View(data)); }
public FacebookAuthProvider(IAppSettings appSettings) : base(appSettings, Realm, Name, "AppId", "AppSecret") { this.AppId = appSettings.GetString("oauth.facebook.AppId"); this.AppSecret = appSettings.GetString("oauth.facebook.AppSecret"); this.Permissions = appSettings.Get("oauth.facebook.Permissions", TypeConstants.EmptyStringArray); this.Fields = appSettings.Get("oauth.facebook.Fields", DefaultFields); NavItem = new NavItem { Href = "/auth/" + Name, Label = "Sign in with Facebook", Id = "btn-" + Name, ClassName = "btn-social btn-facebook", IconClass = "fab svg-facebook", Meta = new Dictionary <string, string> { [Keywords.Allows] = Keywords.Embed }, }; }
public ActionResult AddItem(NavItem item, int groupId) { if (ModelState.IsValid) { var group = _navGroupRepo.Get(groupId); if (group == null) { ModelState.AddModelError("Group", "Nav Group is missing."); } else { item.Group = group; _navItemRepo.Add(item); _navItemRepo.Save(); return(RedirectToAction("Items", new { id = item.Group.Id })); } } return(View(item)); }
public void NavItem_UpdateNavItem_ReturnsEditedNavItem() { // Get navItem to update NavItem navItem = MockNavItemRepository.Get(1); string expectedNavItemEnName = "Edit New Nav Item 1"; navItem.EnName = expectedNavItemEnName; // try updating our new navItem MockNavItemRepository.Update(navItem); // verify that our navItem has been updated NavItem testNavItem = MockNavItemRepository.Get(1); Assert.NotNull(testNavItem); // Test if null Assert.IsType <NavItem>(testNavItem); // Test type Assert.Equal(expectedNavItemEnName, testNavItem.EnName); // Verify it has the expected navItemId }
public async Task <ActionResult> AccountUsers(int id) { Debug.WriteLine($"App-Debug: {(nameof(AccountsController))} {nameof(AccountUsers)} {id}"); var usersView = await _siteConnector.DownloadView( SupportServices.Portal, _identity, $"resources/users/{id}/accounts/"); var accountUsersViewModel = new AccountUsersViewModel { Account = _accountViewModels.Accounts.FirstOrDefault(x => x.AccountId == id), View = usersView }; if (NavItem.IsAResourceRequest(Request)) { return(View("_accountUsers", accountUsersViewModel)); } var entityType = "Account.User"; var identifiers = new Dictionary <string, string> { { "accountId", $"{id}" } }; var menuNavItems = NavItem.TransformNavItems( MvcApplication.NavItems .Where(x => x.Key.StartsWith($"{_menuType}")) .ToDictionary(x => x.Key, x => x.Value), _siteConnector.Services[SupportServices.Portal], identifiers ).Select(s => s.Value).ToList(); ViewBag.Menu = Menu.ConfigureMenu(menuNavItems, entityType, new List <string> { entityType }, MenuOrientations.Vertical); return(View("_accountUsers", accountUsersViewModel)); }
public async Task <IActionResult> GetDetails(int id) { try { NavItem item = await _Db.NavItems.FindAsync(id); if (item == null) { return(NotFound(new ResponseHelper("Something went wrong, please try again later"))); } await _Db.Entry(item).Reference(i => i.Page).LoadAsync(); await _Db.Entry(item).Collection(i => i.NavItemPages).LoadAsync(); foreach (NavItemPage nip in item.NavItemPages) { await _Db.Entry(nip).Reference(n => n.Page).LoadAsync(); } return(Ok(new { item.Id, item.Text, item.Url, pageId = item.Page?.Id, pageName = item.Page?.Name, children = item.NavItemPages.Count > 0 ? item.NavItemPages.OrderBy((nip) => nip.OrderIndex).Select(nip => new { nip.Text, nip.Url, pageId = nip.Page?.Id, pageName = nip.Page?.Name, }) : null })); } catch (Exception ex) { _Logger.LogError("Error retrieving navbar item details", ex.Message); _Logger.LogError(ex.StackTrace); return(BadRequest(new ResponseHelper("Something went wrong, please try again later.", ex.Message))); } }
void ReleaseDesignerOutlets() { if (CancelBarButton != null) { CancelBarButton.Dispose(); CancelBarButton = null; } if (NavItem != null) { NavItem.Dispose(); NavItem = null; } if (SearchBar != null) { SearchBar.Dispose(); SearchBar = null; } }
public async Task <IActionResult> DeleteNavItem(int id) { List <NavCategory> result = (from navcats in _context.NavCategories join nav in _context.NavItems on navcats.NavItem.NavItemID equals nav.NavItemID where nav.NavItemID == id select navcats ).ToList <NavCategory>(); foreach (NavCategory item in result) { _context.NavCategories.Remove(item); _context.SaveChanges(); } NavItem itemNav = _context.NavItems.Find(id); _context.NavItems.Remove(itemNav); _context.SaveChanges(); return(RedirectToAction("Index")); }
public static NavItemVersionViewModel MapToNavViewModel(this NavItem viewModel) { return(new NavItemVersionViewModel() { Id = 0, ParentNavItemId = viewModel.ParentNavItemId, Order = viewModel.Order, IsActive = viewModel.IsActive, IsDeleted = viewModel.IsDeleted, NavItemId = viewModel.Id, ChangeActionEnum = ChangeActionEnum.New, VersionStatusEnum = VersionStatusEnum.Draft, ApprovedById = viewModel.ApprovedById, CreatedById = viewModel.CreatedById, CreationDate = viewModel.CreationDate, EnName = viewModel.EnName, ArName = viewModel.ArName, ApprovalDate = viewModel.ApprovalDate, }); }
void nav1_OnItemClick(NavItem obj) { switch (obj.Text) { case "听诊配置": this.tabControlYDTZ.SelectedTab = tabTZPZ; //InitdgvTZPZ(); break; case "听诊教学": this.tabControlYDTZ.SelectedTab = tabTZJX; //InitdgvTZJX(); break; case "听诊录音": this.tabControlYDTZ.SelectedTab = tabTZLY; //InitdgvTZLY(); break; case "云端听诊": this.tabControlYDTZ.SelectedTab = tabYDTZ; //InitdgvYDTZ(); break; case "远程听诊": this.tabControlYDTZ.SelectedTab = tabYCTZ; //InitdgvYCTZ(); break; case "心肺音库": this.load_cbBoxInit_XY(); this.tabControlYDTZ.SelectedTab = tabXY; //InitdgvXY(); break; case "模拟测试": //InitdgvXY(); this.tabControlYDTZ.SelectedTab = tabMNCS; break; } }
public ActionResult SecondaryNav() { var data = new NavViewModel(); data.SectionCode = ""; // irrelevant as not used var sql = new Sql("where ShowInSecondaryNav=1"); sql.AndIsActive <Page>(); var pages = PageList.Load(sql); foreach (var page in pages) { var item = new NavItem(page); data.NavItems.Add(item); } if (data.NavItems.Count > 0) { data.NavItems[0].CssClass = "first"; } return(View("SecondaryNav", data)); }
private void PrintResults(List <MenuItem> menuItems, int parentId) { foreach (var menuItem in menuItems) { if (parentId == menuItem.ParentId && !navList.Contains(menuItem.Title)) { NavItem navItem = new NavItem { Id = menuItem.Id, Title = menuItem.Title, Link = menuItem.Link }; navSummary.Add(map.NavSummary(menuItems, navItem.Id)); var navPath = map.MapNavTree(menuItems, parentId, navItem.Id); navMap.Add(navPath); Console.WriteLine((new string('\t', navPath.Count - 2)) + "--->" + navItem.Title); navList.Add(navItem.Title); RecurseThroughMenu(menuItems, menuItem.Id); } } }
/*--------------------------------------------------------------------------------------------*/ private T FindCustom <T>(T pMain, NavItem pNavItem, Func <CustomItem, T> pGetPropFunc) where T : Component { T comp = pMain; if (pNavItem == null) { return(comp); } CustomItem cust; vCustomMap.TryGetValue(pNavItem.AutoId, out cust); if (cust != null && pGetPropFunc(cust) != null) { comp = pGetPropFunc(cust); } return(comp); }
/*--------------------------------------------------------------------------------------------*/ internal bool SetAsNearestSegment(bool pIsNearest) { IsNearestHighlight = pIsNearest; if (!pIsNearest || SelectionProgress <= 0) { NavItem.DeselectStickySelections(); } if (!pIsNearest || HighlightProgress < 1) { vSelectionStart = null; IsSelectionPrevented = false; return(false); } if (IsSelectionPrevented || !NavItem.AllowSelection) { vSelectionStart = null; return(false); } if (vSelectionStart == null) { vSelectionStart = DateTime.UtcNow; return(false); } if (SelectionProgress < 1) { return(false); } vSelectionStart = null; IsSelectionPrevented = true; vDistanceUponSelection = HighlightDistance; NavItem.Select(); return(true); }
public ActionResult SubNav(string sectionCode, Models.Page page) { var data = new NavViewModel(); //var sql = new Sql("where ParentPageID=", page.ID); var sql = new Sql(); if (page.ParentPageID != null) { sql.Add("where ParentPageID=", page.ParentPageID.Value); } else { sql.Add("where ParentPageID=", page.ID); } sql.AndIsActive <Page>(); var pages = PageList.Load(sql); foreach (var childPage in pages) { var item = new NavItem(childPage); if (childPage.ID == page.ID) { item.IsSelected = true; } data.NavItems.Add(item); } int selectedItemIndex = data.NavItems.FindIndex(item => item.IsSelected); if (selectedItemIndex > -1) { data.NavItems[selectedItemIndex].CssClass = "active"; } return(View(data)); }
public List <NavGrouping> CreateObjectivesNavList(List <String> destNames) { List <NavGrouping> navList = new List <NavGrouping>(); NavGrouping objective = new NavGrouping(); objective.GroupingHeader = "Objectives"; objective.NavItems = new List <NavItem>(); NavItem objectiveItem = new NavItem(); objectiveItem.DestinationName = indexDestName; objectiveItem.IsFormSubmit = true; objectiveItem.FormID = objectiveFormID; objectiveItem.FormAction = "/objectives"; objectiveItem.SetSelected(destNames); objective.NavItems.Add(objectiveItem); objectiveItem = new NavItem(); objectiveItem.DestinationName = boostedDestName; objectiveItem.IsFormSubmit = true; objectiveItem.FormID = objectiveFormID; objectiveItem.FormAction = "/objectives/boosted"; objectiveItem.SetSelected(destNames); objective.NavItems.Add(objectiveItem); if (User.Identity.IsAuthenticated) { objectiveItem = new NavItem(); objectiveItem.Destination = "/objectives/myobjectives"; objectiveItem.DestinationName = completedDestName; objectiveItem.SetSelected(destNames); objective.NavItems.Add(objectiveItem); } navList.Add(objective); return(navList); }
public List <NavGrouping> CreateHomeAdminNavList(List <String> destNames = null) { if (destNames == null) { destNames = new List <String>(); } List <NavGrouping> navList = CreateHomeNavList(destNames); NavGrouping navGrouping = new NavGrouping(); NavItem navItem = new NavItem(); navGrouping.GroupingHeader = "Admin"; navItem.Destination = "/home"; navItem.DestinationName = "Home"; navGrouping.NavItems.Add(navItem); navItem = new NavItem(); navItem.Destination = "/home/admingroupevents"; navItem.DestinationName = "View Events"; navGrouping.NavItems.Add(navItem); navItem = new NavItem(); navItem.Destination = "/home/adminPOTWs"; navItem.DestinationName = "View POTWs"; navGrouping.NavItems.Add(navItem); navItem = new NavItem(); navItem.Destination = "/Home/AdminSiteNotifications"; navItem.DestinationName = "View Notifications"; navGrouping.NavItems.Add(navItem); navItem = new NavItem(); navItem.Destination = "/Home/AddSiteNotification"; navItem.DestinationName = "Add Notification"; navGrouping.NavItems.Add(navItem); navList.Add(navGrouping); return(navList); }
void ReleaseDesignerOutlets() { if (BaseView != null) { BaseView.Dispose(); BaseView = null; } if (CancelBarButton != null) { CancelBarButton.Dispose(); CancelBarButton = null; } if (NavItem != null) { NavItem.Dispose(); NavItem = null; } if (OptionsContainer != null) { OptionsContainer.Dispose(); OptionsContainer = null; } if (PasswordLabel != null) { PasswordLabel.Dispose(); PasswordLabel = null; } if (SelectBarButton != null) { SelectBarButton.Dispose(); SelectBarButton = null; } }
public static void Init(object[] args, List <Instruction> instructions = null, string content = null) { var navItem = (NavItem)args[0]; NavItem = navItem; Console.Clear(); /* * Render the title area for the function */ Layout.RenderContainedArea(NavItem.Name, '=', true); /* * Render the content area if applicable */ if (!string.IsNullOrWhiteSpace(content)) { Console.WriteLine(content + "\n"); } /* * Render out instructions if applicable */ if (instructions != null && instructions.Count > 0) { BuildInstructions(instructions); } else { string input; do { Layout.RenderContainedArea(" Enter B) to go Back", '-'); input = ConsoleHelper.GetString(); } while (!string.IsNullOrWhiteSpace(input) && !string.Equals(input, "b")); } }
public static NavItemVersion MapToNavItemVersion(this NavItem navItem) { NavItemVersion navItemVersion = new NavItemVersion() { //Id = navItem.NavItemVersionId.Value, ApprovalDate = navItem.ApprovalDate, ApprovedById = navItem.ApprovedById, ArName = navItem.ArName, EnName = navItem.EnName, IsActive = navItem.IsActive, //IsApproved = navItem.IsApproved, //IsDeleted = navItem.IsDeleted, Order = navItem.Order, CreationDate = navItem.CreationDate, CreatedById = navItem.CreatedById, IsDeleted = navItem.IsDeleted, ParentNavItemId = navItem.ParentNavItemId, //StatusId = navItem.NavItemVersion.StatusId, NavItem = navItem }; return(navItemVersion); }
protected override void OnActionExecuted(ActionExecutedContext filterContext) { ViewBag.Version = WebConfigurationManager.AppSettings["AppVersion"]; ViewBag.IsAdmin = AccountsHelper.IsAdmin(filterContext.HttpContext.User.Identity.Name); var mainMenu = new Dictionary<string, NavItem<string>>(); foreach (var cat in _ctx.DContentCategories) { var navGroup = new NavItem<string>(); navGroup.Title = cat.Title; navGroup.Url = cat.Route; foreach (var routeItem in _ctx.VRouteItems.Where(ri => ri.CategoryId == cat.Id).OrderBy(ri => ri.Position)) { navGroup.AddItem(routeItem.RouteTitle, routeItem.Route); } mainMenu[cat.Name] = navGroup; } ViewBag.MainMenu = mainMenu; _ctx.UpdateLastOnline(filterContext.HttpContext.User.Identity.Name, DateTime.UtcNow); base.OnActionExecuted(filterContext); }
private List <NavItem> GetChildren(Models.Page page, string sectionCode) { List <NavItem> children = new List <NavItem>(); // example code: how to add records from other tables as children in the nav //if(page.PageCode.ToLower() == "flights"){ // foreach (var region in Region.LoadRegionsWithCurrentDeals("flights")){ // item.SubPages.Add(new NavItem{Title=region.Name, Url = region.GetUrl()}); // } //} //if(page.PageCode.ToLower() == "holidays"){ // foreach (var destination in Destination.LoadDestinationsWithCurrentDeals("holidays")){ // item.SubPages.Add(new NavItem{Title=destination.Title, Url = destination.GetUrl()}); // } //} foreach (var childPage in page.ChildPages.Active) { var navItem = new NavItem(childPage); children.Add(navItem); navItem.SubPages = GetChildren(childPage, sectionCode); } return(children); }
protected override void OnActionExecuted(ActionExecutedContext filterContext) { ViewBag.Version = WebConfigurationManager.AppSettings["AppVersion"]; ViewBag.IsAdmin = AccountsHelper.IsAdmin(filterContext.HttpContext.User.Identity.Name); var mainMenu = new Dictionary <string, NavItem <string> >(); foreach (var cat in _ctx.DContentCategories) { var navGroup = new NavItem <string>(); navGroup.Title = cat.Title; navGroup.Url = cat.Route; foreach (var routeItem in _ctx.VRouteItems.Where(ri => ri.CategoryId == cat.Id).OrderBy(ri => ri.Position)) { navGroup.AddItem(routeItem.RouteTitle, routeItem.Route); } mainMenu[cat.Name] = navGroup; } ViewBag.MainMenu = mainMenu; _ctx.UpdateLastOnline(filterContext.HttpContext.User.Identity.Name, DateTime.UtcNow); base.OnActionExecuted(filterContext); }
public void SetAllowLinkButton(NavItem from, NavItem to) { _allowLinkButtonFrom = from; _allowLinkButtonTo = to; }
protected virtual void OnClickLinkItem(NavItem item) { if (ClickLinkItem != null) { ClickLinkItem(this, item); } }
public int GetSelectedValue(NavItem item) { int i = (int)item; int value = -1; if (i < 0 || i >= _dropDownLists.Length) return value; int.TryParse(_dropDownLists[i].SelectedValue, out value); return value; }
public void SetAllowDropDownList(NavItem from, NavItem to) { _allowDropDownListFrom = from; _allowDropDownListTo = to; }