当前位置: 首页>>代码示例>>C#>>正文


C# IControllerFactory类代码示例

本文整理汇总了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);
     }
 }
开发者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


注:本文中的IControllerFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。