本文整理汇总了C#中IControllerFactory类的典型用法代码示例。如果您正苦于以下问题:C# IControllerFactory类的具体用法?C# IControllerFactory怎么用?C# IControllerFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IControllerFactory类属于命名空间,在下文中一共展示了IControllerFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public static void Init(IControllerFactory controllerFactory)
{
if (instance == null)
{
instance = new Localization(controllerFactory);
}
}
示例2: ControllerActionInvoker
public ControllerActionInvoker(
[NotNull] ActionContext actionContext,
[NotNull] IReadOnlyList<IFilterProvider> filterProviders,
[NotNull] IControllerFactory controllerFactory,
[NotNull] ControllerActionDescriptor descriptor,
[NotNull] IInputFormattersProvider inputFormatterProvider,
[NotNull] IControllerActionArgumentBinder controllerActionArgumentBinder,
[NotNull] IModelBinderProvider modelBinderProvider,
[NotNull] IModelValidatorProviderProvider modelValidatorProviderProvider,
[NotNull] IValueProviderFactoryProvider valueProviderFactoryProvider,
[NotNull] IScopedInstance<ActionBindingContext> actionBindingContextAccessor,
[NotNull] ITempDataDictionary tempData)
: base(
actionContext,
filterProviders,
inputFormatterProvider,
modelBinderProvider,
modelValidatorProviderProvider,
valueProviderFactoryProvider,
actionBindingContextAccessor)
{
_descriptor = descriptor;
_controllerFactory = controllerFactory;
_argumentBinder = controllerActionArgumentBinder;
_tempData = tempData;
if (descriptor.MethodInfo == null)
{
throw new ArgumentException(
Resources.FormatPropertyOfTypeCannotBeNull("MethodInfo",
typeof(ControllerActionDescriptor)),
"descriptor");
}
}
示例3: RenderRouteHandler
/// <summary>
/// Contructor generally used for unit testing
/// </summary>
/// <param name="controllerFactory"></param>
/// <param name="umbracoContext"></param>
internal RenderRouteHandler(IControllerFactory controllerFactory, UmbracoContext umbracoContext)
{
if (controllerFactory == null) throw new ArgumentNullException("controllerFactory");
if (umbracoContext == null) throw new ArgumentNullException("umbracoContext");
_controllerFactory = controllerFactory;
_umbracoContext = umbracoContext;
}
示例4: BuildExecuteFunc
public Func<IRequest, IArguments, Context, object> BuildExecuteFunc(MethodInfo methodInfo, IControllerFactory controllerFactory, IBinderFactory binderFactory)
{
var parameters = methodInfo.GetParameters();
var localVars = new List<ParameterExpression>();
var typedVars = new Dictionary<int, ParameterExpression>();
var paramVars = new List< ParameterExpression>();
var codeExprs = new List<Expression>();
foreach (ParameterInfo paramInfo in parameters) {
// BuildAssign
}
var getControllerInstance = Expression.Call(Expression.Constant(controllerFactory), GetOrCreateFactoryMethodInfo);
var callAction = Expression.Call(getControllerInstance, methodInfo, paramVars);
var labelTarget = Expression.Label(typeof(object));
var returnValueExpr = Expression.Convert(callAction, typeof(object));
var retExpr = Expression.Return(labelTarget, returnValueExpr);
var labelExpr = Expression.Label(labelTarget, Expression.Constant(null,typeof(object)));
codeExprs.Add(retExpr);
codeExprs.Add(labelExpr);
Expression block = Expression.Block(localVars,codeExprs);
if (block.CanReduce)
{
block = block.ReduceAndCheck();
}
var lamda = Expression.Lambda<Func<IRequest, IArguments, Context,object>>(block);
var result = lamda.Compile();
return result;
}
示例5: MvcDynamicSessionControllerFactory
public MvcDynamicSessionControllerFactory(IControllerFactory originalFactory) {
if (originalFactory == null) {
throw new ArgumentNullException("originalFactory");
}
_originalFactory = originalFactory;
}
示例6: SetControllerFactory
public void SetControllerFactory(IControllerFactory controllerFactory) {
if (controllerFactory == null) {
throw new ArgumentNullException("controllerFactory");
}
_factoryThunk = () => controllerFactory;
}
示例7: SetControllerFactory
public void SetControllerFactory(IControllerFactory controllerFactory)
{
FactoryThunk += delegate()
{
return controllerFactory;
};
}
示例8: ConfigureRegistrar
void ConfigureRegistrar(IControllerFactory factory, IControllerFactoryProcessor processor)
{
var r = new ControllerRegistrar(processor, factory);
r.Add(new ReflectionControllerRegistrar());
_registrar = r;
}
示例9: DefaultMvcHandler
public DefaultMvcHandler(IControllerFactory controllerFactory, IViewEngine viewEngine)
{
Requires.NotNull(controllerFactory, "controllerFactory");
Requires.NotNull(viewEngine, "viewEngine");
_controllerFactory = controllerFactory;
ViewEngineManager.Current.Add(viewEngine);
}
示例10: ModoAdministrador
public ModoAdministrador(IControllerFactory pFactory)
{
this.iContFactory = pFactory;
this.iFactory = new AdminModePagesFactory(this.iContFactory);
InitializeComponent();
this.Load += ModoAdministrador_Load;
}
示例11: ReflectedActionInvokerProvider
public ReflectedActionInvokerProvider(IControllerFactory controllerFactory,
IActionBindingContextProvider bindingProvider,
INestedProviderManager<FilterProviderContext> filterProvider)
{
_controllerFactory = controllerFactory;
_bindingProvider = bindingProvider;
_filterProvider = filterProvider;
}
示例12: RenderRouteHandler
public RenderRouteHandler(IControllerFactory controllerFactory,
IRebelApplicationContext applicationContext,
IRenderModelFactory modelFactory)
{
_modelFactory = modelFactory;
_applicationContext = applicationContext;
_controllerFactory = controllerFactory;
}
示例13: ControllerRouteCatalog
/// <summary>
/// Initializes a new instance of the <see cref="ControllerRouteCatalog"/> class.
/// </summary>
/// <param name="controllerFactory">The controller factory.</param>
/// <param name="viewActivator">The view activator that is used to instantiate views.</param>
public ControllerRouteCatalog(IControllerFactory controllerFactory, IViewActivator viewActivator)
{
Guard.ArgumentNotNull(controllerFactory, "controllerFactory");
this.controllerFactory = controllerFactory;
viewEngines = Framework.ViewEngines.CreateDefaults(viewActivator);
modelBinders = Framework.ModelBinders.CreateDefaults();
handler = new ControllerRouteHandler(this.controllerFactory, viewEngines, modelBinders);
}
示例14: TypeLoader
public TypeLoader(
IControllerFactory controllerFactory,
ISubjectFactory subjectFactory,
IIntrospectionPresenter introspectionPresenter)
: base(introspectionPresenter)
{
_controllerFactory = controllerFactory;
_subjectFactory = subjectFactory;
}
示例15: SinkApplicationContext
public SinkApplicationContext(
IFileWatcherService fileWatcherService,
IControllerFactory controllerFactory,
ISinkApplicationSettings applicationSettings)
{
_controllerFactory = controllerFactory;
_applicationSettings = applicationSettings;
FileWatcherService = fileWatcherService;
}