• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IControllerFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IConversionManager类代码示例发布时间:2022-05-24
下一篇:
C# IControllerContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap