System.Web.Routing.RouteCollectionExtensions.GetInstanceOfRouteHandler C# (CSharp) Method

GetInstanceOfRouteHandler() private static method

private static GetInstanceOfRouteHandler ( RouteConfigurationElement route ) : IRouteHandler
route RouteConfigurationElement
return IRouteHandler
        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);
            }
        }