private static IRouteHandler GetInstanceOfRouteHandler(RouteConfigElement route) { IRouteHandler routeHandler; if (string.IsNullOrEmpty(route.RouteHandlerType)) { routeHandler = new MvcRouteHandler(); } else { try { Type routeHandlerType = Type.GetType(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); } } return(routeHandler); }
private static IRouteHandler GetInstanceOfRouteHandler(RouteConfigElement route) { IRouteHandler routeHandler; if (string.IsNullOrEmpty(route.RouteHandlerType)) { routeHandler = new MvcRouteHandler(); } else { try { Type routeHandlerType = Type.GetType(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); } } return routeHandler; }