本文整理汇总了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));
}
示例2: Configure
public void Configure(FubuRegistry registry)
{
registry.ApplyConvention<AuthorizationConvention>();
registry.Navigation<AuthorizationNavigationRegistry>();
registry.Services(x =>
{
x.ReplaceService<IAuthorizationFailureHandler,AuthorizationFailureHandler>();
});
}
示例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>();
}
示例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));
}
示例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));
}
示例6: Configure
public void Configure(FubuRegistry registry)
{
registry.ApplyConvention<SpecialPolicy>();
registry.Import<SubModule>();
Applied++;
}