コード例 #1
0
        public void Configure(FubuRegistry registry)
        {
            registry.ApplyConvention <SpecialPolicy>();
            registry.Import <SubModule>();

            Applied++;
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        void IFubuRegistryExtension.Configure(FubuRegistry registry)
        {
            registry.Services(services =>
            {
                // This isn't something that changes very often at all
                var encodings = new IHttpContentEncoding[] { new GZipHttpContentEncoding(), new DeflateHttpContentEncoding() };
                var encoders = new HttpContentEncoders(encodings);
                services.SetServiceIfNone<IHttpContentEncoders>(encoders);
            });

            registry.ApplyConvention(new ContentCompressionConvention(_filters.Matches));
        }
コード例 #4
0
        void IFubuRegistryExtension.Configure(FubuRegistry registry)
        {
            registry.Services(services =>
            {
                // This isn't something that changes very often at all
                var encodings = new IHttpContentEncoding[] { new GZipHttpContentEncoding(), new DeflateHttpContentEncoding() };
                var encoders  = new HttpContentEncoders(encodings);
                services.SetServiceIfNone <IHttpContentEncoders>(encoders);
            });

            registry.ApplyConvention(new ContentCompressionConvention(_filters.Matches));
        }
コード例 #5
0
        public static void ApplySmartGridConventions(this FubuRegistry registry, Action <AppliesToExpression> configure)
        {
            var pool = new TypePool(null);

            pool.IgnoreCallingAssembly();

            var expression = new AppliesToExpression(pool);

            configure(expression);

            registry.ApplyConvention(new SmartGridConvention(pool));
        }
コード例 #6
0
 public ViewExpression RegisterActionLessViews(Func <Type, bool> viewTypeFilter, Action <BehaviorChain> configureChain)
 {
     _registry.ApplyConvention(new ActionLessViewConvention(_viewAttacher.Facilities, _viewAttacher.Types, viewTypeFilter, configureChain));
     return(this);
 }