예제 #1
0
        public FubuRegistry()
        {
            _observer = new NulloConfigurationObserver();

            _viewAttacher = new ViewAttacher(_types);

            // Default method filters
            Actions.IgnoreMethodsDeclaredBy<object>();
            Actions.IgnoreMethodsDeclaredBy<MarshalByRefObject>();
            Actions.IgnoreMethodsDeclaredBy<IDisposable>();

            // Add Behaviors First
            addConvention(graph => _behaviorMatcher.BuildBehaviors(_types, graph));
            addConvention(graph => _actionSourceMatcher.BuildBehaviors(_types, graph));
            addConvention(graph => _routeResolver.ApplyToAll(graph));

            Policies.Add<StringOutputPolicy>();
            Policies.Add<WebFormsEndpointPolicy>();
            Policies.Add<ContinuationHandlerConvention>();

            _systemPolicies.Add(new AttachAuthorizationPolicy());

            Output.ToHtml.WhenCallMatches(x => x.Method.HasAttribute<HtmlEndpointAttribute>());
            Output.ToJson.WhenCallMatches(x => x.Method.HasAttribute<JsonEndpointAttribute>());
            Output.ToJson.WhenTheOutputModelIs<JsonMessage>();

            Output.To<RenderHtmlDocumentNode>().WhenTheOutputModelIs<HtmlDocument>();
            Output.To<RenderHtmlTagNode>().WhenTheOutputModelIs<HtmlTag>();

            _conventions.Add(_viewAttacher);
            Policies.Add<JsonMessageInputConvention>();
            Policies.Add<UrlRegistryCategoryConvention>();
            Policies.Add<UrlForNewConvention>();
        }
예제 #2
0
        public FubuRegistry()
        {
            _observer = new NulloConfigurationObserver();
            _viewAttacher = new ViewAttacher(_types);

            setupDefaultConventionsAndPolicies();
        }
예제 #3
0
        public FubuRegistry()
        {
            _viewAttacher = new ViewAttacher(_types);

            // Default method filters
            Actions.IgnoreMethodsDeclaredBy<object>();
            Actions.IgnoreMethodsDeclaredBy<MarshalByRefObject>();
            Actions.IgnoreMethodsDeclaredBy<IDisposable>();

            // Add Behaviors First
            addConvention(graph => _behaviorMatcher.BuildBehaviors(_types, graph));
            addConvention(graph => _routeResolver.ApplyToAll(graph));

            Policies.Add<StringOutputPolicy>();
            Policies.Add<WebFormsEndpointPolicy>();
            Policies.Add<ContinuationHandlerConvention>();

            HtmlOutputIf.CallMatches(x => x.Method.HasCustomAttribute<HtmlEndpointAttribute>());
            JsonOutputIf.CallMatches(x => x.Method.HasCustomAttribute<JsonEndpointAttribute>());

            OutputIs<RenderHtmlDocumentNode>().WhenTheOutputModelIs<HtmlDocument>();
            OutputIs<RenderHtmlTagNode>().WhenTheOutputModelIs<HtmlTag>();

            _conventions.Add(_viewAttacher);
        }
예제 #4
0
        public FubuRegistry()
        {
            _behaviorMatcher = new BehaviorMatcher((type, methodInfo) => _actionCallProvider(type, methodInfo));
            _observer = new NulloConfigurationObserver();
            _viewAttacher = new ViewAttacher(_types);

            setupDefaultConventionsAndPolicies();
        }
예제 #5
0
 public void Setup()
 {
     var types = new TypePool();
     _observer = new RecordingConfigurationObserver();
     _action = ActionCall.For<ViewsForActionFilterTesterController>(x => x.AAction());
     _fromFindsOne = new FakeViewToken();
     _fromSecondFindsOne = new FakeViewToken();
     _views = new ViewBag(new IViewToken[] { _fromFindsOne, _fromSecondFindsOne });
     _filterThatFindsNone = createFilterThatReturns(new IViewToken[0]);
     _firstFilterThatFindsExactlyOne = createFilterThatReturns(_fromFindsOne);
     _secondFilterThatFindsExactlyOne = createFilterThatReturns(_fromSecondFindsOne);
     _filterThatFindsMultiple = createFilterThatReturns(_fromFindsOne, _fromSecondFindsOne);
     _viewAttacher = new ViewAttacher(types);
 }
예제 #6
0
 public ViewExpression(ViewAttacher viewAttacher, FubuRegistry registry)
 {
     _viewAttacher = viewAttacher;
     _registry = registry;
 }
예제 #7
0
 public ViewExpression(ViewAttacher viewAttacher)
 {
     _viewAttacher = viewAttacher;
 }