Esempio n. 1
0
        private NavigationContext CreateNavigationContext(string path, string queryString)
        {
            // Create http context
            var queryStringDictionary = new Dictionary <string, string>();

            if (queryString != null)
            {
                var parts = queryString.Split(new[] { '&' });
                foreach (var part in parts)
                {
                    var pair  = part.Split(new[] { '=' });
                    var key   = HttpUtility.UrlDecode(pair[0]);
                    var value = HttpUtility.UrlDecode(pair[1]);
                    queryStringDictionary[key] = value;
                }
            }
            var routeData = routeTree.Apply(path, "GET");
            var request   = new NavigationRequest
            {
                Path        = path,
                QueryString = queryStringDictionary,
                RouteData   = routeData
            };
            var response = new NavigationResponse();

            var navigationContext = new NavigationContext
            {
                Request  = request,
                Response = response
            };

            return(navigationContext);
        }
Esempio n. 2
0
        private NavigationContext CreateNavigationContext(string path, string queryString)
        {
            // Create http context
            var queryStringDictionary = new Dictionary<string, string>();
            if (queryString != null)
            {
                var parts = queryString.Split(new[] { '&' });
                foreach (var part in parts)
                {
                    var pair = part.Split(new[] { '=' });
                    var key = HttpUtility.UrlDecode(pair[0]);
                    var value = HttpUtility.UrlDecode(pair[1]);
                    queryStringDictionary[key] = value;
                }
            }
            var routeData = routeTree.Apply(path, "GET");
            var request = new NavigationRequest
            {
                Path = path,
                QueryString = queryStringDictionary,
                RouteData = routeData
            };
            var response = new NavigationResponse();

            var navigationContext = new NavigationContext
            {
                Request = request,
                Response = response
            };

            return navigationContext;
        }