Exemplo n.º 1
0
        public string Parse(string parameters)
        {
            try
            {
                if (!string.IsNullOrEmpty(parameters))
                {
                    RouteValueDictionary routes = new RouteValueDictionary();
                    var list     = parameters.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                    var pageName = list[0].Trim();
                    foreach (var item in list.Skip(1))
                    {
                        var keyValue = Split(item);
                        if (!string.IsNullOrEmpty(keyValue.Key))
                        {
                            routes[keyValue.Key] = keyValue.Value;
                        }
                    }

                    if (!HasIllegalCharacters(pageName, false))
                    {
                        return(_pageUrlGenerator.PageUrl(pageName, routes));
                    }
                }
                return(null);
            }
            catch (Exception e)
            {
                Kooboo.HealthMonitoring.Log.LogException(e);
                return(null);
            }
        }
Exemplo n.º 2
0
        public string Parse(string parameters)
        {
            if (!string.IsNullOrEmpty(parameters))
            {
                RouteValueDictionary routes = new RouteValueDictionary();
                var list     = parameters.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                var pageName = list[0].Trim();
                foreach (var item in list.Skip(1))
                {
                    var keyValue = Split(item);
                    if (!string.IsNullOrEmpty(keyValue.Key))
                    {
                        routes[keyValue.Key] = keyValue.Value;
                    }
                }

                return(_pageUrlGenerator.PageUrl(pageName, routes));
            }
            return(null);
        }