コード例 #1
0
        private static NavigationHubStatus OnQueryStatusCallback(
            NavigationHub hub,
            TfsWebContext tfsWebContext,
            ControllerBase controller)
        {
            if (tfsWebContext == null)
            {
                return(null);
            }

            // this gets the appropriate route name for the NavigationContextLevel of the current context.
            var controllerActionRouteName = TfsRouteHelpers.GetControllerActionRouteName(tfsWebContext);

            // builds the ActionLink using that NavigationContextLevel appropriate route
            var actionLink = tfsWebContext.Url.RouteUrl(
                controllerActionRouteName,
                "index",
                "customhome",
                new { routeArea = string.Empty });

            return(new NavigationHubStatus(hub)
            {
                HubGroup = WellKnownHubGroup.Custom,
                HubGroupDisplayText = CustomAreaName,
                DisplayText = "Echo",
                CommandId = "Custom.CustomHome.Index",
                Order = 100,
                ActionLink = actionLink,
                ActionArguments = new { message = "None" },
                Selected = controller is CustomHomeController
            });
        }
コード例 #2
0
        private static NavigationHubStatus OnQueryStatusCallback(
            NavigationHub hub,
            TfsWebContext tfsWebContext,
            ControllerBase controller)
        {
            if (tfsWebContext == null)
            {
                return null;
            }

            // this gets the appropriate route name for the NavigationContextLevel of the current context.
            var controllerActionRouteName = TfsRouteHelpers.GetControllerActionRouteName(tfsWebContext);

            // builds the ActionLink using that NavigationContextLevel appropriate route
            var actionLink = tfsWebContext.Url.RouteUrl(
                controllerActionRouteName,
                "index",
                "customhome",
                new { routeArea = string.Empty });

            return new NavigationHubStatus(hub)
            {
                HubGroup = WellKnownHubGroup.Custom,
                HubGroupDisplayText = CustomAreaName,
                DisplayText = "Echo",
                CommandId = "Custom.CustomHome.Index",
                Order = 100,
                ActionLink = actionLink,
                ActionArguments = new { message = "None" },
                Selected = controller is CustomHomeController
            };
        }