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


C# FubuRegistry.ApplyConvention方法代码示例

本文整理汇总了C#中FubuMVC.Core.FubuRegistry.ApplyConvention方法的典型用法代码示例。如果您正苦于以下问题:C# FubuRegistry.ApplyConvention方法的具体用法?C# FubuRegistry.ApplyConvention怎么用?C# FubuRegistry.ApplyConvention使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FubuMVC.Core.FubuRegistry的用法示例。


在下文中一共展示了FubuRegistry.ApplyConvention方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConfigureRegistry

        public void ConfigureRegistry(FubuRegistry registry)
        {
            registry.Services(x =>
                                  {
                                      var handler = x.SetServiceIfNone(typeof (IValidationFailureHandler), typeof (ValidationFailureHandler));
                                      handler.Dependencies.Add(_policies);
                                  });

            registry
                .ApplyConvention(new ValidationConvention(_callMatcher.CallFilters.Matches));
        }
开发者ID:petejohanson,项目名称:fubumvc,代码行数:11,代码来源:ConfigureValidationExpression.cs

示例2: Configure

        public void Configure(FubuRegistry registry)
        {
            registry.ApplyConvention<AuthorizationConvention>();

            registry.Navigation<AuthorizationNavigationRegistry>();

            registry.Services(x =>
            {
                x.ReplaceService<IAuthorizationFailureHandler,AuthorizationFailureHandler>();
            });
        }
开发者ID:mtscout6,项目名称:FubuMVC.Blog,代码行数:11,代码来源:AuthorizationRegistry.cs

示例3: Configure

        public void Configure(FubuRegistry registry)
        {
            registry.ApplyConvention<NavigationRootPolicy>(x =>
            {
                x.ForKey(DiagnosticKeys.Main);
                x.WrapWithChrome<DashboardChrome>();

                x.Alter(chain => chain.BehaviorChain.Route.Prepend("_fubu"));
            });

            registry.Navigation<DiagnosticsMenu>();
        }
开发者ID:bobpace,项目名称:FubuMVC.Diagnostics,代码行数:12,代码来源:DiagnosticsChromeExtension.cs

示例4: ValidationConvention

        void IFubuRegistryExtension.Configure(FubuRegistry registry)
        {
            registry.Services(x =>
            {
                x.SetServiceIfNone<IValidationContinuationHandler, ValidationContinuationHandler>();
                x.SetServiceIfNone<IAjaxContinuationResolver, AjaxContinuationResolver>();
                x.SetServiceIfNone<IAjaxContinuationActivator, AjaxContinuationActivator>();
                x.AddService<IAjaxContinuationDecorator, StandardAjaxContinuationDecorator>();

                x.SetServiceIfNone<IModelBindingErrors, ModelBindingErrors>();

                x.SetServiceIfNone<IValidationFailureHandler, ValidationFailureHandler>();
                _validationPolicies
                    .Each(policy => x.AddService(typeof (IValidationFailurePolicy), policy));
            });

            registry
                .ApplyConvention(new ValidationConvention(_callMatcher.CallFilters.Matches));
        }
开发者ID:krisdages,项目名称:fubuvalidation,代码行数:19,代码来源:FubuValidationEngine.cs

示例5: FieldRulesRegistry

        void IFubuRegistryExtension.Configure(FubuRegistry registry)
        {
            registry
                .Services(x =>
                              {
                                  var validationRegistry = _validationRegistry as IValidationRegistration;
                                  var rulesRegistry = new FieldRulesRegistry(validationRegistry.FieldSources(), new TypeDescriptorCache());
                                  validationRegistry.RegisterFieldRules(rulesRegistry);

                                  x.AddService<IValidationSource>(new FieldRuleSource(rulesRegistry));
                                  x.SetServiceIfNone<IFieldRulesRegistry>(rulesRegistry);
                                  x.SetServiceIfNone<IValidator, Validator>();
                                  x.SetServiceIfNone<IValidationQuery, ValidationQuery>();
                                  x.SetServiceIfNone<IValidationContinuationHandler, ValidationContinuationHandler>();
                                  x.SetServiceIfNone<IFieldValidationQuery, FieldValidationQuery>();

                                  x.SetServiceIfNone<IValidationFailureHandler, ValidationFailureHandler>();
                                  _validationPolicies
                                      .Each(policy => x.AddService(typeof(IValidationFailurePolicy), policy));
                              });

            registry
                .ApplyConvention(new ValidationConvention(_callMatcher.CallFilters.Matches));
        }
开发者ID:satish860,项目名称:fubuvalidation,代码行数:24,代码来源:FubuValidationEngine.cs

示例6: Configure

 public void Configure(FubuRegistry registry)
 {
     registry.ApplyConvention<SpecialPolicy>();
     registry.Import<SubModule>();
     Applied++;
 }
开发者ID:aluetjen,项目名称:fubumvc,代码行数:6,代码来源:DoubleRegistrationOfImports.cs


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