/// <summary> /// Prepare the breadcrumbs model for this view. /// </summary> /// <param name="package"></param> private void ConfigureBreadCrumbs(Package package) { // Set up the breadcrumbs for this action var breadCrumbs = new BreadCrumbs(); breadCrumbs.Add(new BreadCrumb( SettingsHelper.GetCatalogBreadcrumbsBaseLabel(), "Index", "Home")); breadCrumbs.Add(new BreadCrumb( package.Title)); ViewData["BreadCrumbs"] = breadCrumbs; }
public void ShowAllGroups() { try { CurrentWrapper = null; CurrentWrapperIsGroup = true; BreadCrumbs.Clear(); BreadCrumbs.Add(null); CurrentWrapperList.Clear(); AllGroupFilters.Clear(); foreach (GroupFilterVM grpFilter in GroupFilterHelper.AllGroupFilters) { //if (grpFilter.FilterConditions.Count == 0) // AllGroupFilter = grpFilter; AllGroupFilters.Add(grpFilter); CurrentWrapperList.Add(grpFilter); } ShowChildWrappers(AllGroupFilter); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Load" /> event. /// </summary> /// <param name="e">The <see cref="T:System.EventArgs" /> object that contains the event data.</param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (Page.IsPostBack) { LoadChannelControl(false); } else { ShowAllRecipients = false; string itemId = PageParameter("CommunicationId"); if (!string.IsNullOrWhiteSpace(itemId)) { ShowDetail("CommunicationId", int.Parse(itemId)); } else { ShowDetail("CommunicationId", 0); } } BreadCrumbs.Add(new BreadCrumb(PageTitle, true)); }
public void ShowAllGroups() { try { CurrentWrapper = null; CurrentWrapperIsGroup = true; BreadCrumbs.Clear(); BreadCrumbs.Add(null); CurrentWrapperList.Clear(); foreach (GroupFilterVM grpFilter in AllGroupFiltersDictionary.Values) { //if (grpFilter.FilterConditions.Count == 0) // AllGroupFilter = grpFilter; if (!grpFilter.GroupFilterParentId.HasValue) { CurrentWrapperList.Add(grpFilter); } } ShowChildWrappers(AllGroupFilter); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
private void UpdateBreadkCrumbs() { BreadCrumbs.Clear(); var breakCrumbs = ConvertToBreadCrumbs(_nodeHistoryState); foreach (var breadCrumbViewmodel in breakCrumbs) { BreadCrumbs.Add(breadCrumbViewmodel); } }
/// <summary> /// Configure the breadcrumbs for this controller. /// </summary> /// <param name="q">The query</param> /// <param name="tag">The selected tag</param> private void ConfigureBreadCrumbs(string q, string tag) { // Set up the breadcrumbs for this action var breadCrumbs = new BreadCrumbs(); breadCrumbs.Add(new BreadCrumb( SettingsHelper.GetCatalogBreadcrumbsBaseLabel(), "Index", "Home")); // Add breadcrumb for the search action breadCrumbs.Add(new BreadCrumb( "Search")); // Add breadcrumb for the search filter (query) if (!String.IsNullOrEmpty(q)) { var routeValues = RouteHelper.RouteFromParameters(RouteData.Values); // Create a route that removes the q parameter breadCrumbs.Add(new BreadCrumb( String.Format("Query: {0}", q), "Index", RouteHelper.UpdateRoute(routeValues, "q", ""), true) ); } // Add breadcrumb for the tag filter if (!String.IsNullOrEmpty(tag)) { var routeValues = RouteHelper.RouteFromParameters(RouteData.Values); // Create a route that removes the tag parameter breadCrumbs.Add(new BreadCrumb( String.Format("Tag: {0}", tag), "Index", RouteHelper.UpdateRoute(routeValues, "tag", ""), true) ); } ViewData["BreadCrumbs"] = breadCrumbs; }
// // GET: /Cache/ public ActionResult Index(string token) { CheckToken(token); CkanClient client = CkanHelper.GetClient(); var cachedItems = client.GetCachedRequests(); // Set up the breadcrumbs for this action var breadCrumbs = new BreadCrumbs(); breadCrumbs.Add(new BreadCrumb(SettingsHelper.GetCatalogBreadcrumbsBaseLabel(), "Index", "Home")); breadCrumbs.Add(new BreadCrumb("Admin")); breadCrumbs.Add(new BreadCrumb("Cache")); ViewData["BreadCrumbs"] = breadCrumbs; // Disable analytics on admin pages ViewData["DisableAnalytics"] = true; return View(cachedItems); }
private void DrillDown(object obj) { Node n = obj as Node; if (n == null) { return; } BreadCrumbs.Add(n); }
// // GET: /Cache/ public ActionResult Index(string token) { CheckToken(token); CkanClient client = CkanHelper.GetClient(); var cachedItems = client.GetCachedRequests(); // Set up the breadcrumbs for this action var breadCrumbs = new BreadCrumbs(); breadCrumbs.Add(new BreadCrumb(SettingsHelper.GetCatalogBreadcrumbsBaseLabel(), "Index", "Home")); breadCrumbs.Add(new BreadCrumb("Admin")); breadCrumbs.Add(new BreadCrumb("Cache")); ViewData["BreadCrumbs"] = breadCrumbs; // Disable analytics on admin pages ViewData["DisableAnalytics"] = true; return(View(cachedItems)); }
/// <summary> /// Prepare the breadcrumbs model for this view. /// </summary> private void ConfigureBreadCrumbs() { if (SettingsHelper.GetBreadcrumbsHomeEnabled()) { // Set up the breadcrumbs for this action var breadCrumbs = new BreadCrumbs(); breadCrumbs.Add(new BreadCrumb( SettingsHelper.GetCatalogBreadcrumbsBaseLabel())); ViewData["BreadCrumbs"] = breadCrumbs; } }
/// <summary> /// Display the error view /// </summary> /// <param name="errorPresentation"></param> public static void DisplayErrorView(ErrorPresentation errorPresentation) { // Return the error view ViewResult result = new ViewResult(); result.ViewName = "Error"; result.ViewData = new ViewDataDictionary(errorPresentation); // Set up the breadcrumbs for the view var breadCrumbs = new BreadCrumbs(); breadCrumbs.Add(new BreadCrumb( "Home", "Index", "Home")); breadCrumbs.Add(new BreadCrumb( "Error")); result.ViewData.Add("BreadCrumbs", breadCrumbs); // Get the context for the error controller HttpContext context = HttpContext.Current; if (context.CurrentHandler is MvcHandler) { RequestContext requestContext = ((MvcHandler)context.CurrentHandler).RequestContext; //string controllerName = rc.RouteData.GetRequiredString("Error"); IControllerFactory factory = ControllerBuilder.Current.GetControllerFactory(); IController controller = factory.CreateController(requestContext, "Error"); ControllerContext controllerContext = new ControllerContext(requestContext, (ControllerBase)controller); // Execute the view results result.ExecuteResult(controllerContext); context.Server.ClearError(); } }
/// <summary> /// Get the breadcrumbs model for this view. /// </summary> private BreadCrumbs GetBreadCrumbs(string title) { BreadCrumbs breadCrumbs = null; if (SettingsHelper.GetBreadcrumbsEnabled()) { // Set up the breadcrumbs for this action breadCrumbs = new BreadCrumbs(); breadCrumbs.Add(new BreadCrumb( SettingsHelper.GetCatalogBreadcrumbsBaseLabel(), "Index", "Home")); // Add breadcrumb for the search action if (!String.IsNullOrEmpty(title)) { breadCrumbs.Add(new BreadCrumb( title)); } } return(breadCrumbs); }
/// <summary> /// Get the breadcrumbs model for this view. /// </summary> private BreadCrumbs GetBreadCrumbs(string title) { BreadCrumbs breadCrumbs = null; if (SettingsHelper.GetBreadcrumbsEnabled()) { // Set up the breadcrumbs for this action breadCrumbs = new BreadCrumbs(); breadCrumbs.Add(new BreadCrumb( SettingsHelper.GetCatalogBreadcrumbsBaseLabel(), "Index", "Home")); // Add breadcrumb for the search action if (!String.IsNullOrEmpty(title)) { breadCrumbs.Add(new BreadCrumb( title)); } } return breadCrumbs; }
/// <summary> /// Configure the breadcrumbs for this controller. /// </summary> /// <param name="q">The query</param> /// <param name="tag">The selected tag</param> private void ConfigureBreadCrumbs(string q, string tag) { // Set up the breadcrumbs for this action var breadCrumbs = new BreadCrumbs(); breadCrumbs.Add(new BreadCrumb( SettingsHelper.GetCatalogBreadcrumbsBaseLabel(), "Index", "Home")); // Add breadcrumb for the search action breadCrumbs.Add(new BreadCrumb( "Search")); // Add breadcrumb for the search filter (query) if (!String.IsNullOrEmpty(q)) { var routeValues = RouteHelper.RouteFromParameters(RouteData.Values); // Create a route that removes the q parameter breadCrumbs.Add(new BreadCrumb( String.Format("Query: {0}", q), "Index", RouteHelper.UpdateRoute(routeValues, "q", ""), true) ); } // Add breadcrumb for the tag filter if (!String.IsNullOrEmpty(tag)) { var routeValues = RouteHelper.RouteFromParameters(RouteData.Values); // Create a route that removes the tag parameter breadCrumbs.Add(new BreadCrumb( String.Format("Tag: {0}",tag), "Index", RouteHelper.UpdateRoute(routeValues, "tag", ""), true) ); } ViewData["BreadCrumbs"] = breadCrumbs; }
//[LogExecutionTime] public void ShowChildWrappers(MainListWrapper wrapper) { try { CurrentWrapper = wrapper; CurrentWrapperIsGroup = wrapper is GroupFilterVM; CurrentListWrapperIsGroup = wrapper is AnimeGroupVM; if (wrapper is AnimeGroupVM) { //LastAnimeGroupID = ((AnimeGroupVM)wrapper).AnimeGroupID.Value; MainListHelperVM.Instance.CurrentOpenGroupFilter = "AnimeGroupVM|" + ((AnimeGroupVM)wrapper).AnimeGroupID.Value; } if (wrapper is GroupFilterVM) { CurrentGroupFilter = (GroupFilterVM)wrapper; //LastGroupFilterID = ((GroupFilterVM)wrapper).GroupFilterID.Value; MainListHelperVM.Instance.CurrentOpenGroupFilter = "GroupFilterVM|" + ((GroupFilterVM)wrapper).GroupFilterID.Value; } if (wrapper is AnimeSeriesVM) { CurrentSeries = wrapper as AnimeSeriesVM; //LastAnimeSeriesID = ((AnimeSeriesVM)wrapper).AnimeSeriesID.Value; MainListHelperVM.Instance.CurrentOpenGroupFilter = "NoGroup"; } if (wrapper == null) { MainListHelperVM.Instance.CurrentOpenGroupFilter = "Init"; } System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate() { // update wrappers // check where this wrapper sits in the heirarchy and remove anything below it int pos = -1; if (wrapper != null) { for (int i = 0; i < BreadCrumbs.Count; i++) { if (wrapper is GroupFilterVM && BreadCrumbs[i] is GroupFilterVM) { GroupFilterVM wrapObj = wrapper as GroupFilterVM; GroupFilterVM bcObj = BreadCrumbs[i] as GroupFilterVM; if (wrapObj.FilterName == bcObj.FilterName) { pos = i; } } if (wrapper is AnimeGroupVM && BreadCrumbs[i] is AnimeGroupVM) { AnimeGroupVM wrapObj = wrapper as AnimeGroupVM; AnimeGroupVM bcObj = BreadCrumbs[i] as AnimeGroupVM; if (wrapObj.AnimeGroupID == bcObj.AnimeGroupID) { pos = i; } } if (wrapper is AnimeSeriesVM && BreadCrumbs[i] is AnimeSeriesVM) { AnimeSeriesVM wrapObj = wrapper as AnimeSeriesVM; AnimeSeriesVM bcObj = BreadCrumbs[i] as AnimeSeriesVM; if (wrapObj.AnimeSeriesID == bcObj.AnimeSeriesID) { pos = i; } } if (wrapper is AnimeEpisodeTypeVM && BreadCrumbs[i] is AnimeEpisodeTypeVM) { AnimeEpisodeTypeVM wrapObj = wrapper as AnimeEpisodeTypeVM; AnimeEpisodeTypeVM bcObj = BreadCrumbs[i] as AnimeEpisodeTypeVM; if (wrapObj.EpisodeTypeDescription == bcObj.EpisodeTypeDescription) { pos = i; } } if (wrapper is AnimeEpisodeVM && BreadCrumbs[i] is AnimeEpisodeVM) { AnimeEpisodeVM wrapObj = wrapper as AnimeEpisodeVM; AnimeEpisodeVM bcObj = BreadCrumbs[i] as AnimeEpisodeVM; if (wrapObj.AnimeEpisodeID == bcObj.AnimeEpisodeID) { pos = i; } } } } else { pos = 0; } if (pos >= 0) { for (int i = BreadCrumbs.Count - 1; i >= 0; i--) { if (i >= pos) { BreadCrumbs.RemoveAt(i); } } } BreadCrumbs.Add(wrapper); if (wrapper is GroupFilterVM) { if (AllGroupsDictionary.Count == 0) { RefreshGroupsSeriesData(); } // apply sorting // get default sorting from the group filter } // means we are at the top level if (wrapper == null) { CurrentWrapperList.Clear(); foreach (GroupFilterVM grpFilter in AllGroupFiltersDictionary.Values.Where(a => !a.GroupFilterParentId.HasValue).OrderBy(a => a.FilterName)) { CurrentWrapperList.Add(grpFilter); } } else { CurrentWrapperList.Clear(); foreach (MainListWrapper wp in wrapper.GetDirectChildren()) { CurrentWrapperList.Add(wp); } } SetGroupFilterSortingOnMainList(); ViewGroups.Refresh(); //new FilterMainListBox(ViewGroups, SearchTextBox, CurrentGroupFilter); }); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
//[LogExecutionTime] public void ShowChildWrappers(IListWrapper wrapper) { try { CurrentWrapper = wrapper; CurrentWrapperIsGroup = wrapper is VM_GroupFilter; CurrentListWrapperIsGroup = wrapper is VM_AnimeGroup_User; if (wrapper is VM_AnimeGroup_User) { //LastAnimeGroupID = ((VM_AnimeGroup_User)wrapper).AnimeGroupID.Value; Instance.CurrentOpenGroupFilter = "VM_AnimeGroup_User|" + ((VM_AnimeGroup_User)wrapper).AnimeGroupID; } if (wrapper is VM_GroupFilter) { CurrentGroupFilter = (VM_GroupFilter)wrapper; //LastGroupFilterID = ((GroupFilterVM)wrapper).GroupFilterID.Value; Instance.CurrentOpenGroupFilter = "GroupFilterVM|" + ((VM_GroupFilter)wrapper).GroupFilterID; } if (wrapper is VM_AnimeSeries_User) { CurrentSeries = (VM_AnimeSeries_User)wrapper; //LastAnimeSeriesID = ((VM_AnimeSeries_User)wrapper).AnimeSeriesID.Value; Instance.CurrentOpenGroupFilter = "NoGroup"; } if (wrapper == null) { Instance.CurrentOpenGroupFilter = "Init"; } Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (Action) delegate { // update wrappers // check where this wrapper sits in the heirarchy and remove anything below it int pos = -1; if (wrapper != null) { for (int i = 0; i < BreadCrumbs.Count; i++) { if (BreadCrumbs[i] == null) { continue; } if (wrapper is VM_GroupFilter && BreadCrumbs[i] is VM_GroupFilter) { VM_GroupFilter wrapObj = (VM_GroupFilter)wrapper; VM_GroupFilter bcObj = (VM_GroupFilter)BreadCrumbs[i]; if (wrapObj.GroupFilterName == bcObj.GroupFilterName) { pos = i; } } else if (wrapper is VM_AnimeGroup_User && BreadCrumbs[i] is VM_AnimeGroup_User) { VM_AnimeGroup_User wrapObj = (VM_AnimeGroup_User)wrapper; VM_AnimeGroup_User bcObj = (VM_AnimeGroup_User)BreadCrumbs[i]; if (wrapObj.AnimeGroupID == bcObj.AnimeGroupID) { pos = i; } } else if (wrapper is VM_AnimeSeries_User && BreadCrumbs[i] is VM_AnimeSeries_User) { VM_AnimeSeries_User wrapObj = (VM_AnimeSeries_User)wrapper; VM_AnimeSeries_User bcObj = (VM_AnimeSeries_User)BreadCrumbs[i]; if (wrapObj.AnimeSeriesID == bcObj.AnimeSeriesID) { pos = i; } } else if (wrapper is VM_AnimeEpisodeType && BreadCrumbs[i] is VM_AnimeEpisodeType) { VM_AnimeEpisodeType wrapObj = (VM_AnimeEpisodeType)wrapper; VM_AnimeEpisodeType bcObj = (VM_AnimeEpisodeType)BreadCrumbs[i]; if (wrapObj.EpisodeTypeDescription == bcObj.EpisodeTypeDescription) { pos = i; } } else if (wrapper is VM_AnimeEpisode_User && BreadCrumbs[i] is VM_AnimeEpisode_User) { VM_AnimeEpisode_User wrapObj = (VM_AnimeEpisode_User)wrapper; VM_AnimeEpisode_User bcObj = (VM_AnimeEpisode_User)BreadCrumbs[i]; if (wrapObj.AnimeEpisodeID == bcObj.AnimeEpisodeID) { pos = i; } } } } else { pos = 0; } if (pos > 0) { for (int i = BreadCrumbs.Count - 1; i >= 0; i--) { if (i >= pos) { BreadCrumbs.RemoveAt(i); } } } else if (pos == 0) { BreadCrumbs.Clear(); } BreadCrumbs.Add(wrapper); if (wrapper is VM_GroupFilter) { if (AllGroupsDictionary.Count == 0) { RefreshGroupsSeriesData(); } // apply sorting // get default sorting from the group filter } // means we are at the top level if (wrapper == null) { CurrentWrapperList.Clear(); foreach (VM_GroupFilter grpFilter in AllGroupFiltersDictionary.Values .Where(a => a != null && !a.ParentGroupFilterID.HasValue).OrderBy(a => a.GroupFilterName)) { CurrentWrapperList.Add(grpFilter); } } else { CurrentWrapperList.Clear(); foreach (IListWrapper wp in wrapper.GetDirectChildren()) { CurrentWrapperList.Add(wp); } } SetGroupFilterSortingOnMainList(); ViewGroups.Refresh(); //new FilterMainListBox(ViewGroups, SearchTextBox, CurrentGroupFilter); }); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public void AddBreadCrumb(NavigationItem current) { BreadCrumbs.Add(current); }