private static IRouteHandler GetInstanceOfRouteHandler(RouteConfigurationElement route)
{
if (String.IsNullOrEmpty(route.RouteHandlerType))
return new MvcRouteHandler();
try
{
Type routeHandlerType = Type.GetType(route.RouteHandlerType);
return Activator.CreateInstance(routeHandlerType) as IRouteHandler;
}
catch (Exception ex)
{
var message = String.Format("Can't create an instance of IRouteHandler {0}", route.RouteHandlerType);
throw new ApplicationException(message, ex);
}
}