Exemplo n.º 1
0
        internal string GetRouteValuesDescriptor()
        {
            lock ( _sync )
            {
                if (_routeValuesDescriptor != null)
                {
                    return(_routeValuesDescriptor);
                }

                List <string> list = new List <string>();

                foreach (var key in RouteKeys.OrderBy(k => k, StringComparer.OrdinalIgnoreCase))
                {
                    string value;

                    if (StaticRouteValues.TryGetValue(key, out value))
                    {
                        list.Add(string.Format("<\"{0}\",\"{1}\">", key.Replace("\"", "\\\""), value.Replace("\"", "\\\"")));
                    }

                    else
                    {
                        list.Add(string.Format("<\"{0}\",dynamic>", key.Replace("\"", "\\\"")));
                    }
                }

                return(_routeValuesDescriptor = string.Join(",", list.ToArray()));
            }
        }