Esempio n. 1
0
        public static string GetCurrentConfigExtPropertyValue(string extPropertyName)
        {
            RoutingItem item = GetCurrentConfigRouteItem();

            if (item == null || item.ExtProperties == null || item.ExtProperties.Count <= 0)
            {
                return(null);
            }
            var t = item.ExtProperties[extPropertyName];

            if (t == null)
            {
                return(null);
            }
            return(t.Value);
        }
Esempio n. 2
0
        private static RoutingItem FindRoutingItem(string routeName)
        {
            routeName = routeName.Trim().ToLower();
            RouteConfigurationSection section = RouteConfig.GetRouteConfiguration();
            RoutingItem curRouteItem          = null;

            if (section.Areas != null && section.Areas.Count > 0)
            {
                foreach (AreaItem area in section.Areas)
                {
                    if (area.Map == null || area.Map.Count <= 0)
                    {
                        continue;
                    }
                    foreach (RoutingItem routingItem in area.Map)
                    {
                        if (routingItem.Name.ToLower().Trim() == routeName)
                        {
                            curRouteItem = routingItem;
                            break;
                        }
                    }
                    if (curRouteItem != null)
                    {
                        break;
                    }
                }
            }
            if (curRouteItem == null && section.Map != null && section.Map.Count > 0)
            {
                foreach (RoutingItem routingItem in section.Map)
                {
                    if (routingItem.Name.ToLower().Trim() == routeName)
                    {
                        curRouteItem = routingItem;
                        break;
                    }
                }
            }
            return(curRouteItem);
        }