RouteConfig 구성파일의 Element 정보
Inheritance: System.Configuration.ConfigurationElement
コード例 #1
0
 public void Remove(RouteConfigElement url)
 {
     if (BaseIndexOf(url) >= 0)
     {
         BaseRemove(url.Name);
     }
 }
コード例 #2
0
        /// <summary>
        /// Gets the instance of route handler.
        /// </summary>
        /// <param name="route">The route.</param>
        /// <returns>IRouteHandler</returns>
        private static IRouteHandler GetInstanceOfRouteHandler(RouteConfigElement route)
        {
            IRouteHandler routeHandler;

            if (IsDebugEnabled)
            {
                log.Debug("route={0}", route);
            }

            if (route.RouteHandlerType.IsWhiteSpace())
            {
                routeHandler = new RouteHandler <Page>(route.VirtualPath, true);
            }
            else
            {
                try
                {
                    Type routeHandlerType = Type.GetType(route.RouteHandlerType);

                    if (IsDebugEnabled)
                    {
                        log.Debug("route={0}, routeHandlerType={1}", route, routeHandlerType);
                    }

                    routeHandler = Activator.CreateInstance(routeHandlerType) as IRouteHandler;
                }
                catch (Exception e)
                {
                    throw new ApplicationException(string.Format("Can't create an instance of IRouteHandler {0}", route.RouteHandlerType), e);
                }
            }

            if (IsDebugEnabled)
            {
                log.Debug("route={0}, routeHandler={1}", route, routeHandler);
            }

            return(routeHandler);
        }
コード例 #3
0
ファイル: RouteCollection.cs プロジェクト: debop/NFramework
 public void Add(RouteConfigElement url)
 {
     BaseAdd(url);
 }
コード例 #4
0
ファイル: RouteCollection.cs プロジェクト: debop/NFramework
 public int IndexOf(RouteConfigElement url)
 {
     return BaseIndexOf(url);
 }
コード例 #5
0
ファイル: RouteCollection.cs プロジェクト: debop/NFramework
 public void Remove(RouteConfigElement url)
 {
     if(BaseIndexOf(url) >= 0)
         BaseRemove(url.Name);
 }
コード例 #6
0
 /// <summary>
 /// Gets the data tokens.
 /// </summary>
 /// <param name="route">The route.</param>
 /// <returns>RouteValueDictionary</returns>
 private static RouteValueDictionary GetDataTokens(RouteConfigElement route)
 {
     return GetRouteValueDictionary(route.DataTokens.Attributes);
 }
コード例 #7
0
 /// <summary>
 /// Gets the defaults.
 /// </summary>
 /// <param name="route">The route.</param>
 /// <returns>RouteValueDictionary</returns>
 private static RouteValueDictionary GetDefaults(RouteConfigElement route)
 {
     return GetRouteValueDictionary(route.Defaults.Attributes);
 }
コード例 #8
0
 /// <summary>
 /// Gets the constraints.
 /// </summary>
 /// <param name="route">The route.</param>
 /// <returns>RouteValueDictionary</returns>
 private static RouteValueDictionary GetConstraints(RouteConfigElement route)
 {
     return GetRouteValueDictionary(route.Constraints.Attributes);
 }
コード例 #9
0
        /// <summary>
        /// Gets the instance of route handler.
        /// </summary>
        /// <param name="route">The route.</param>
        /// <returns>IRouteHandler</returns>
        private static IRouteHandler GetInstanceOfRouteHandler(RouteConfigElement route)
        {
            IRouteHandler routeHandler;

            if(IsDebugEnabled)
                log.Debug("route={0}", route);

            if(route.RouteHandlerType.IsWhiteSpace())
                routeHandler = new RouteHandler<Page>(route.VirtualPath, true);
            else
            {
                try
                {
                    Type routeHandlerType = Type.GetType(route.RouteHandlerType);

                    if(IsDebugEnabled)
                        log.Debug("route={0}, routeHandlerType={1}", route, routeHandlerType);

                    routeHandler = Activator.CreateInstance(routeHandlerType) as IRouteHandler;
                }
                catch(Exception e)
                {
                    throw new ApplicationException(string.Format("Can't create an instance of IRouteHandler {0}", route.RouteHandlerType), e);
                }
            }

            if(IsDebugEnabled)
                log.Debug("route={0}, routeHandler={1}", route, routeHandler);

            return routeHandler;
        }
コード例 #10
0
 public void Add(RouteConfigElement url)
 {
     BaseAdd(url);
 }
コード例 #11
0
 public int IndexOf(RouteConfigElement url)
 {
     return(BaseIndexOf(url));
 }
コード例 #12
0
 /// <summary>
 /// Gets the data tokens.
 /// </summary>
 /// <param name="route">The route.</param>
 /// <returns>RouteValueDictionary</returns>
 private static RouteValueDictionary GetDataTokens(RouteConfigElement route)
 {
     return(GetRouteValueDictionary(route.DataTokens.Attributes));
 }
コード例 #13
0
 /// <summary>
 /// Gets the defaults.
 /// </summary>
 /// <param name="route">The route.</param>
 /// <returns>RouteValueDictionary</returns>
 private static RouteValueDictionary GetDefaults(RouteConfigElement route)
 {
     return(GetRouteValueDictionary(route.Defaults.Attributes));
 }
コード例 #14
0
 /// <summary>
 /// Gets the constraints.
 /// </summary>
 /// <param name="route">The route.</param>
 /// <returns>RouteValueDictionary</returns>
 private static RouteValueDictionary GetConstraints(RouteConfigElement route)
 {
     return(GetRouteValueDictionary(route.Constraints.Attributes));
 }