Esempio n. 1
0
        public void Configure(FubuRegistry registry)
        {
            registry
                .Actions
                .FindWith<ExplicitControllerRegistration>();

            registry
                .Views
                .TryToAttachWithDefaultConventions()
                .TryToAttachViewsInPackages();

            registry
                .UseSpark(spark => spark.ConfigureComposer(c => c.AddBinder<DiagnosticsTemplateBinder>()));

            registry.Configure(graph =>
                                   {
                                       var chain = graph.FindHomeChain();
                                       if (chain == null)
                                       {
                                           graph
                                               .BehaviorFor<GettingStartedController>(x => x.Execute(new GettingStartedRequestModel()))
                                               .Route = new RouteDefinition(string.Empty);
                                       }
                                   });
        }
Esempio n. 2
0
        public void Configure(FubuRegistry registry)
        {
            registry.Applies
                .ToAllPackageAssemblies()
                .ToThisAssembly();

            registry.Actions
                .IncludeType<AwesomeMenuHandler>()
                .FindWith<RestfulHandlerActionSource>();

            registry.Routes
                .UrlPolicy<AwesomeCreateRoutingConvention>()
                .UrlPolicy<AwesomeEditRoutingConvention>()
                .UrlPolicy<RestfulCreateRoutingConvention>()
                .UrlPolicy<RestfulDeleteRoutingConvention>()
                .UrlPolicy<RestfulIndexRoutingConvention>()
                .UrlPolicy<RestfulPatchRoutingConvention>()
                .UrlPolicy<RestfulFindRoutingConvention>();

            registry.Models
                .BindModelsWith<EntityModelBinder>();

            registry.Output.ToJson.WhenCallMatches(x => x.HandlerType.IsGenericType);

            registry.UseSpark();

            registry.Views
                .TryToAttachWithDefaultConventions()
                .TryToAttachViewsInPackages()
                .ApplyConvention<IndexViewPolicy>()
                .ApplyConvention<CreateViewPolicy>();

            registry.HtmlConvention<AwesomeHtmlConventions>();
        }
 protected override void configure(FubuRegistry registry)
 {
     registry.UseSpark();
     registry.Actions.IncludeType<ProfileController>();
     registry.Views.TryToAttachWithDefaultConventions();
     registry.Views.Profile<Mobile>("m.");
     registry.IncludeDiagnostics(true);
 }
 protected override void configure(FubuRegistry registry)
 {
     registry.UseSpark();
     registry.IncludeDiagnostics(true);
     registry.Actions.IncludeType<PartialController>();
     registry.Views.RegisterActionLessViews(v => v.ViewModel == typeof (PartialInput));
     registry.Views.RegisterActionLessViews(v => v.ViewModel == typeof (MoreInput));
     registry.Views.TryToAttachWithDefaultConventions();
 }