本文整理汇总了C#中IControllerFactory类的典型用法代码示例。如果您正苦于以下问题:C# IControllerFactory类的具体用法?C# IControllerFactory怎么用?C# IControllerFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IControllerFactory类属于命名空间,在下文中一共展示了IControllerFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Init
public static void Init(IControllerFactory controllerFactory)
{
if (instance == null)
{
instance = new Localization(controllerFactory);
}
}
开发者ID:supermuk,项目名称:iudico,代码行数:7,代码来源:Localization.cs
示例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");
}
}
开发者ID:AndersBillLinden,项目名称:Mvc,代码行数:34,代码来源:ControllerActionInvoker.cs
示例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;
}
开发者ID:Jeavon,项目名称:Umbraco-CMS,代码行数:12,代码来源:RenderRouteHandler.cs
示例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;
}
开发者ID:yanyitec,项目名称:yitec,代码行数:31,代码来源:CommandBuilder.cs
示例5: MvcDynamicSessionControllerFactory
public MvcDynamicSessionControllerFactory(IControllerFactory originalFactory) {
if (originalFactory == null) {
throw new ArgumentNullException("originalFactory");
}
_originalFactory = originalFactory;
}
开发者ID:consumentor,项目名称:Server,代码行数:7,代码来源:MvcDynamicSessionControllerFactory.cs
示例6: SetControllerFactory
public void SetControllerFactory(IControllerFactory controllerFactory) {
if (controllerFactory == null) {
throw new ArgumentNullException("controllerFactory");
}
_factoryThunk = () => controllerFactory;
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:ControllerBuilder.cs
示例7: SetControllerFactory
public void SetControllerFactory(IControllerFactory controllerFactory)
{
FactoryThunk += delegate()
{
return controllerFactory;
};
}
开发者ID:kcly3027,项目名称:kyCMS,代码行数:7,代码来源:ControllerBuilder.cs
示例8: ConfigureRegistrar
void ConfigureRegistrar(IControllerFactory factory, IControllerFactoryProcessor processor)
{
var r = new ControllerRegistrar(processor, factory);
r.Add(new ReflectionControllerRegistrar());
_registrar = r;
}
开发者ID:RookieOne,项目名称:Chimera,代码行数:7,代码来源:ControllerConfig.cs
示例9: DefaultMvcHandler
public DefaultMvcHandler(IControllerFactory controllerFactory, IViewEngine viewEngine)
{
Requires.NotNull(controllerFactory, "controllerFactory");
Requires.NotNull(viewEngine, "viewEngine");
_controllerFactory = controllerFactory;
ViewEngineManager.Current.Add(viewEngine);
}
开发者ID:richardhopton,项目名称:Meridian,代码行数:8,代码来源:DefaultMVCHandler.cs
示例10: ModoAdministrador
public ModoAdministrador(IControllerFactory pFactory)
{
this.iContFactory = pFactory;
this.iFactory = new AdminModePagesFactory(this.iContFactory);
InitializeComponent();
this.Load += ModoAdministrador_Load;
}
开发者ID:ramarivera,项目名称:TpFinalTDP2015,代码行数:8,代码来源:ModoAdministrador.cs
示例11: ReflectedActionInvokerProvider
public ReflectedActionInvokerProvider(IControllerFactory controllerFactory,
IActionBindingContextProvider bindingProvider,
INestedProviderManager<FilterProviderContext> filterProvider)
{
_controllerFactory = controllerFactory;
_bindingProvider = bindingProvider;
_filterProvider = filterProvider;
}
开发者ID:Nakro,项目名称:Mvc,代码行数:8,代码来源:ReflectedActionInvokerProvider.cs
示例12: RenderRouteHandler
public RenderRouteHandler(IControllerFactory controllerFactory,
IRebelApplicationContext applicationContext,
IRenderModelFactory modelFactory)
{
_modelFactory = modelFactory;
_applicationContext = applicationContext;
_controllerFactory = controllerFactory;
}
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:8,代码来源:RenderRouteHandler.cs
示例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);
}
开发者ID:p69,项目名称:magellan-framework,代码行数:13,代码来源:ControllerRouteCatalog.cs
示例14: TypeLoader
public TypeLoader(
IControllerFactory controllerFactory,
ISubjectFactory subjectFactory,
IIntrospectionPresenter introspectionPresenter)
: base(introspectionPresenter)
{
_controllerFactory = controllerFactory;
_subjectFactory = subjectFactory;
}
开发者ID:igor-toporet,项目名称:TestFx,代码行数:9,代码来源:TypeLoader.cs
示例15: SinkApplicationContext
public SinkApplicationContext(
IFileWatcherService fileWatcherService,
IControllerFactory controllerFactory,
ISinkApplicationSettings applicationSettings)
{
_controllerFactory = controllerFactory;
_applicationSettings = applicationSettings;
FileWatcherService = fileWatcherService;
}
开发者ID:ninjaboy,项目名称:blue-crocodile,代码行数:9,代码来源:SinkApplicationContext.cs
示例16: ProcessInit
public void ProcessInit(out IControllerFactory controllerFactory,out IController controller,ControllerContext controllerContext)
{
//Instanciate controllerFactory
string controllerName = controllerContext.RequestContext.RouteData.GetRequiredString("Controller");
controllerFactory = new DefaultControllerFactory(); //又他么写死了。
controller = controllerFactory.CreateController(controllerName);
controllerContext.Controller = controller as Controller;
//关于这边的写法,我认为controllerContext不应该属于defaultcontrollerfactory,而应该只是作为外界传进去的一个参数,所以不应该把controllerContext作为工厂的一个属性或者变量存在。
}
开发者ID:swfightforyl,项目名称:XMVC,代码行数:9,代码来源:MvcHandler.cs
示例17: ControllerFactoryWrapper
/// <summary>
/// Initializes a new instance of the <see cref="ControllerFactoryWrapper"/> class that wraps the specified controller factory.
/// </summary>
/// <param name="controllerFactory">The controller factory to wrap.</param>
/// <exception cref="ArgumentNullException"><paramref name="controllerFactory"/> is <c>null</c>.</exception>
public ControllerFactoryWrapper(IControllerFactory controllerFactory)
{
if (controllerFactory == null)
{
throw new ArgumentNullException("controllerFactory");
}
this.mControllerFactory = controllerFactory;
}
开发者ID:ivanaliptakova,项目名称:Mvc,代码行数:14,代码来源:ControllerFactoryWrapper.cs
示例18:
Controller INavigationResult.GetController(IControllerFactory controllerFactory, Stack<Controller> controllerHistory)
{
if (controllerHistory.Count > 0)
{
return controllerHistory.Pop();
}
return null;
}
开发者ID:bfriesen,项目名称:BadSnowstorm,代码行数:9,代码来源:GoBack.cs
示例19: ServerEventsProcessor
public ServerEventsProcessor(IControllerFactory controllerFactory)
{
if (controllerFactory == null)
throw new ArgumentNullException("controllerFactory");
this.controllerFactory = controllerFactory;
this.OperatorProcessor = new OperatorProcessor(this.controllerFactory);
this.ChatProcessor = new ChatProcessor(this.controllerFactory);
}
开发者ID:KatrukSergii,项目名称:CallCenter,代码行数:10,代码来源:ServerEventsProcessor.cs
示例20: ProxyControllerFactory
public void ProxyControllerFactory(ExecutionInspector sut, IInspectorContext context, IControllerFactory controllerFactory)
{
context.ProxyFactory.Setup(f => f.IsWrapInterfaceEligible<IControllerFactory>(It.IsAny<Type>())).Returns(true);
context.ProxyFactory.Setup(f => f.WrapInterface(It.IsAny<IControllerFactory>(), It.IsAny<IEnumerable<IAlternateMethod>>(), Enumerable.Empty<object>())).Returns(controllerFactory);
sut.Setup(context);
Assert.Equal(ControllerBuilder.Current.GetControllerFactory(), controllerFactory);
context.Logger.Verify(l => l.Debug(It.Is<string>(s => s.Contains("IControllerFactory")), It.IsAny<object[]>()));
}
开发者ID:GProulx,项目名称:Glimpse,代码行数:10,代码来源:ExecutionShould.cs
注:本文中的IControllerFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论