public static ControllerInfo Create(Type controllerType, RegisterSettings registerSettings, CodeRoutingProvider provider) { ControllerDescriptor controllerDescr = null; if (createActionInvoker != null) { Controller instance = null; try { instance = (Controller)FormatterServices.GetUninitializedObject(controllerType); } catch (SecurityException) { } if (instance != null) { ControllerActionInvoker actionInvoker = createActionInvoker(instance) as ControllerActionInvoker; if (actionInvoker != null) { controllerDescr = getControllerDescriptor(actionInvoker, new ControllerContext { Controller = instance }); } } } if (controllerDescr != null) { return new DescribedMvcControllerInfo(controllerDescr, controllerType, registerSettings, provider); } return new ReflectedMvcControllerInfo(controllerType, registerSettings, provider); }
public static ControllerInfo Create(Type controllerType, RegisterSettings registerSettings, CodeRoutingProvider provider) { HttpConfiguration configuration = registerSettings.Settings.HttpConfiguration(); if (configuration == null) { throw new ArgumentException( "You must first specify an {0} instance using the HttpConfiguration key on {1}.Properties.".FormatInvariant( typeof(HttpConfiguration).FullName, typeof(CodeRoutingSettings).FullName ) ); } return new DescribedHttpControllerInfo( new HttpControllerDescriptor( configuration, controllerType.Name.Substring(0, controllerType.Name.Length - "Controller".Length), controllerType), controllerType, registerSettings, provider ); }
public DescribedMvcControllerInfo(ControllerDescriptor controllerDescr, Type type, RegisterSettings registerSettings, CodeRoutingProvider provider) : base(type, registerSettings, provider) { this.controllerDescr = controllerDescr; }
protected ControllerInfo(Type type, RegisterSettings registerSettings, CodeRoutingProvider provider) { this.Type = type; this.Register = registerSettings; this.Provider = provider; }
public MvcControllerInfo(Type type, RegisterSettings registerSettings, CodeRoutingProvider provider) : base(type, registerSettings, provider) { }
public static ControllerInfo Create(Type controllerType, RegisterSettings registerSettings, CodeRoutingProvider provider) { ControllerDescriptor controllerDescr = null; if (createActionInvoker != null) { Controller instance = null; try { instance = (Controller)FormatterServices.GetUninitializedObject(controllerType); } catch (SecurityException) { } if (instance != null) { ControllerActionInvoker actionInvoker = createActionInvoker(instance) as ControllerActionInvoker; if (actionInvoker != null) { controllerDescr = getControllerDescriptor(actionInvoker, new ControllerContext { Controller = instance }); } } } if (controllerDescr != null) { return(new DescribedMvcControllerInfo(controllerDescr, controllerType, registerSettings, provider)); } return(new ReflectedMvcControllerInfo(controllerType, registerSettings, provider)); }
public static ControllerInfo Create(Type controllerType, RegisterSettings registerSettings, CodeRoutingProvider provider) { HttpConfiguration configuration = registerSettings.Settings.HttpConfiguration(); if (configuration == null) { throw new ArgumentException( "You must first specify an {0} instance using the HttpConfiguration key on {1}.Properties.".FormatInvariant( typeof(HttpConfiguration).FullName, typeof(CodeRoutingSettings).FullName ) ); } return(new DescribedHttpControllerInfo( new HttpControllerDescriptor( configuration, controllerType.Name.Substring(0, controllerType.Name.Length - "Controller".Length), controllerType), controllerType, registerSettings, provider )); }
public DescribedHttpControllerInfo(HttpControllerDescriptor controllerDescr, Type type, RegisterSettings registerSettings, CodeRoutingProvider provider) : base(type, registerSettings, provider) { this.controllerDescr = controllerDescr; }