コード例 #1
0
        public void Apply(BehaviorGraph graph, BehaviorChain chain)
        {
            // Don't override the route if it already exists
            if (chain.Route != null)
            {
                return;
            }

            // Don't override the route if the chain is a partial
            if (chain.IsPartialOnly)
            {
                return;
            }

            _observer = graph.Observer;

            ActionCall call = chain.Calls.FirstOrDefault();

            if (call == null)
            {
                return;
            }

            IUrlPolicy policy = _policies.FirstOrDefault(x => x.Matches(call, _observer)) ?? _defaultUrlPolicy;

            _observer.RecordCallStatus(call, "First matching UrlPolicy (or default): {0}".ToFormat(policy.GetType().Name));

            IRouteDefinition route = policy.Build(call);

            _constraintPolicy.Apply(call, route, _observer);

            _observer.RecordCallStatus(call, "Route definition determined by url policy: [{0}]".ToFormat(route.ToRoute().Url));
            chain.Route = route;
        }
コード例 #2
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            var result = call.InputType() == _inputType;

            if (result && _foundCallAlready)
            {
                throw new FubuException(1003,
                                        "Cannot make input type '{0}' the default route as there is more than one action that uses that input type. Either choose a input type that is used by only one action, or use the other overload of '{1}' to specify the actual action method that will be called by the default route.",
                                        _inputType.Name,
                                        ReflectionHelper.GetMethod<RouteConventionExpression>(r => r.HomeIs<object>()).
                                            Name
                    );
            }

            if (result) _foundCallAlready = true;

            if (result && log.IsRecording)
            {
                log.RecordCallStatus(call,
                                     "Action '{0}' is the default route since its input type is {1} which was specified in the configuration as the input model for the default route"
                                         .ToFormat(call.Method.Name, _inputType.Name));
            }

            return result;
        }
コード例 #3
0
ファイル: FubuRegistry.cs プロジェクト: talonhawk1/fubumvc
        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>();
        }
コード例 #4
0
        public void AttemptToAttachViewToAction(ViewBag bag, ActionCall call, IConfigurationObserver observer)
        {
            foreach (var filter in _filters)
            {
                var viewTokens = filter.Apply(call, bag);
                var count      = viewTokens.Count();

                observer.RecordCallStatus(call, "View filter '{0}' found {1} view token{2}".ToFormat(
                                              filter.GetType().Name, count, (count != 1) ? "s" : ""));

                if (count > 0)
                {
                    viewTokens.Each(t =>
                                    observer.RecordCallStatus(call, "Found view token: {0}".ToFormat(t)));
                }

                // if the filter returned more than one, consider it "failed", ignore it, and move on to the next
                if (count != 1)
                {
                    continue;
                }

                var token = viewTokens.First();
                observer.RecordCallStatus(call, "Selected view token: {0}".ToFormat(token));
                call.AddToEnd(token.ToBehavioralNode());
                break;
            }
        }
コード例 #5
0
        public void Apply(BehaviorGraph graph, BehaviorChain chain)
        {
            // Don't override the route if it already exists
            if (chain.Route != null)
            {
                return;
            }

            // Don't override the route if the chain is a partial
            if (chain.IsPartialOnly)
            {
                return;
            }

            _observer = graph.Observer;

            ActionCall call = chain.Calls.FirstOrDefault();
            if (call == null) return;

            IUrlPolicy policy = _policies.FirstOrDefault(x => x.Matches(call, _observer)) ?? _defaultUrlPolicy;
            _observer.RecordCallStatus(call, "First matching UrlPolicy (or default): {0}".ToFormat(policy.GetType().Name));

            IRouteDefinition route = policy.Build(call);
            _constraintPolicy.Apply(call, route, _observer);

            _observer.RecordCallStatus(call, "Route definition determined by url policy: [{0}]".ToFormat(route.ToRoute().Url));
            chain.Route = route;
        }
コード例 #6
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            var result = call.InputType() == _inputType;

            if (result && _foundCallAlready)
            {
                throw new FubuException(1003,
                                        "Cannot make input type '{0}' the default route as there is more than one action that uses that input type. Either choose a input type that is used by only one action, or use the other overload of '{1}' to specify the actual action method that will be called by the default route.",
                                        _inputType.Name,
                                        ReflectionHelper.GetMethod <RouteConventionExpression>(r => r.HomeIs <object>()).Name
                                        );
            }

            if (result)
            {
                _foundCallAlready = true;
            }

            if (result && log.IsRecording)
            {
                log.RecordCallStatus(call,
                                     "Action '{0}' is the default route since its input type is {1} which was specified in the configuration as the input model for the default route"
                                     .ToFormat(call.Method.Name, _inputType.Name));
            }

            return(result);
        }
コード例 #7
0
        public FubuRegistry()
        {
            _observer     = new NulloConfigurationObserver();
            _viewAttacher = new ViewAttacher(_types);

            setupDefaultConventionsAndPolicies();
        }
コード例 #8
0
ファイル: FubuRegistry.cs プロジェクト: RobertTheGrey/fubumvc
        public FubuRegistry()
        {
            _observer = new NulloConfigurationObserver();
            _viewAttacher = new ViewAttacher(_types);

            setupDefaultConventionsAndPolicies();
        }
コード例 #9
0
ファイル: ViewAttacher.cs プロジェクト: JamieDraperUK/fubumvc
        public void AttemptToAttachViewToAction(ViewBag bag, ActionCall call, IConfigurationObserver observer)
        {
            foreach (var filter in _filters)
            {
                var viewTokens = filter.Apply(call, bag);
                var count = viewTokens.Count();

                observer.RecordCallStatus(call, "View filter '{0}' found {1} view token{2}".ToFormat(
                    filter.GetType().Name, count, (count != 1) ? "s" : "" ));

                if( count > 0 )
                {
                    viewTokens.Each(t =>
                        observer.RecordCallStatus(call, "Found view token: {0}".ToFormat(t)));
                }

                // if the filter returned more than one, consider it "failed", ignore it, and move on to the next
                if (count == 1)
                {
                    var token = viewTokens.First();
                    observer.RecordCallStatus(call, "Selected view token: {0}".ToFormat(token));
                    call.AddToEnd(token.ToBehavioralNode());
                    break;
                }
            }
        }
コード例 #10
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            var listingHandlerType = typeof(ListingHandler<,>);
            String handlerNamePrefix = listingHandlerType
                .Name.Substring(0, listingHandlerType.Name.IndexOf("`"));

            return call.HandlerType.Name.StartsWith(handlerNamePrefix);
        }
コード例 #11
0
        public FubuRegistry()
        {
            _behaviorMatcher = new BehaviorMatcher((type, methodInfo) => _actionCallProvider(type, methodInfo));
            _observer        = new NulloConfigurationObserver();
            _viewAttacher    = new ViewAttacher(_types);

            setupDefaultConventionsAndPolicies();
        }
コード例 #12
0
ファイル: FubuRegistry.cs プロジェクト: drusellers/fubumvc
        public FubuRegistry()
        {
            _behaviorMatcher = new BehaviorMatcher((type, methodInfo) => _actionCallProvider(type, methodInfo));
            _observer = new NulloConfigurationObserver();
            _viewAttacher = new ViewAttacher(_types);

            setupDefaultConventionsAndPolicies();
        }
コード例 #13
0
 public void SetUp()
 {
     _observer = MockRepository.GenerateStub<IConfigurationObserver>();
     _graph = new FubuRegistry(x =>
             {
                 x.Actions.IncludeType<FakeController>();
                 x.UsingObserver(_observer);
             }).BuildGraph();
 }
コード例 #14
0
        public override bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if (!call.IsDiagnosticsHandler())
            {
                return(false);
            }

            return(base.Matches(call, log));
        }
コード例 #15
0
 public void SetUp()
 {
     _observer = MockRepository.GenerateStub <IConfigurationObserver>();
     _graph    = new FubuRegistry(x =>
     {
         x.Actions.IncludeType <FakeController>();
         x.UsingObserver(_observer);
     }).BuildGraph();
 }
コード例 #16
0
        public override bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if(!call.IsDiagnosticsHandler())
            {
                return false;
            }

            return base.Matches(call, log);
        }
コード例 #17
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if(!call.IsDiagnosticsEndpoint())
            {
                return false;
            }

            log.RecordCallStatus(call, "Matched on {0}".ToFormat(GetType().Name));
            return true;
        }
コード例 #18
0
ファイル: HandlersUrlPolicy.cs プロジェクト: rmueller/fubumvc
        public virtual bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if (!IsHandlerCall(call))
            {
                return(false);
            }

            log.RecordCallStatus(call, "Matched on {0}".ToFormat(GetType().Name));
            return(true);
        }
コード例 #19
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if(!call.Method.HasAttribute<FubuDiagnosticsUrlAttribute>())
            {
                return false;
            }

            log.RecordCallStatus(call, "Matched on {0}".ToFormat(GetType().Name));
            return true;
        }
コード例 #20
0
ファイル: FubuRegistry.cs プロジェクト: rmueller/fubumvc
        public FubuRegistry()
        {
            _behaviorAggregator     = new BehaviorAggregator(_types, _actionSources);
            _observer               = new NulloConfigurationObserver();
            _viewAttacherConvention = new ViewAttacherConvention();
            _bagRunner              = new ViewBagConventionRunner(_types);
            _connegAttachmentPolicy = new ConnegAttachmentPolicy(_types);

            setupDefaultConventionsAndPolicies();
        }
コード例 #21
0
        public void Apply(ActionCall call, IRouteDefinition routeDefinition, IConfigurationObserver observer)
        {
            _httpMethodFilters.Where(x => x.Filter(call)).Each(filter =>
            {
                observer.RecordCallStatus(call,
                                          "Adding route constraint {0} based on filter [{1}]".ToFormat(filter.Method, filter.Description));

                routeDefinition.AddHttpMethodConstraint(filter.Method);
            });
        }
コード例 #22
0
        public void Apply(ActionCall call, IRouteDefinition routeDefinition, IConfigurationObserver observer)
        {
            _httpMethodFilters.Where(x => x.Filter(call)).Each(filter =>
            {
                observer.RecordCallStatus(call,
                    "Adding route constraint {0} based on filter [{1}]".ToFormat(filter.Method, filter.Description));

                routeDefinition.AddHttpMethodConstraint(filter.Method);
            });
        }
コード例 #23
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if(!call.HandlerType.Name.EndsWith(ENDPOINT))
            {
                return false;
            }

            log.RecordCallStatus(call, "Matched on {0}".ToFormat(GetType().Name));
            return true;
        }
コード例 #24
0
ファイル: FubuRegistry.cs プロジェクト: spascoe/fubumvc
        public FubuRegistry()
        {
            _behaviorAggregator = new BehaviorAggregator(_types, _actionSources);
            _observer = new NulloConfigurationObserver();
            _viewAttacherConvention = new ViewAttacherConvention();
            _bagRunner = new ViewBagConventionRunner(_types);
            _connegAttachmentPolicy = new ConnegAttachmentPolicy(_types);

            setupDefaultConventionsAndPolicies();
        }
コード例 #25
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if (!call.Method.HasAttribute <FubuDiagnosticsUrlAttribute>())
            {
                return(false);
            }

            log.RecordCallStatus(call, "Matched on {0}".ToFormat(GetType().Name));
            return(true);
        }
コード例 #26
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if (!call.IsDiagnosticsEndpoint())
            {
                return(false);
            }

            log.RecordCallStatus(call, "Matched on {0}".ToFormat(GetType().Name));
            return(true);
        }
コード例 #27
0
ファイル: HandlersUrlPolicy.cs プロジェクト: mkmurray/fubumvc
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if ((!call.HandlerType.Name.ToLower().EndsWith(HANDLER.ToLower()) && !HandlerExpression.IsMatch(call.HandlerType.Name))
                || call.Method.HasAttribute<UrlPatternAttribute>())
            {
                return false;
            }

            log.RecordCallStatus(call, "Matched on {0}".ToFormat(GetType().Name));
            return true;
        }
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if (log.IsRecording)
            {
                log.RecordCallStatus(call, "This route will have /special in front of it");
            }

            //Use FubuCore.TypeExtensions to aid the readability of your conventions
            //by using .CanBeCastTo<>() and other helper methods to match against types
            return call.HasOutput && call.OutputType().CanBeCastTo<string>();
        }
コード例 #29
0
ファイル: MethodToUrlBuilder.cs プロジェクト: jemacom/fubumvc
        public static void Alter(IRouteDefinition route, ActionCall call, IConfigurationObserver observer)
        {
            var properties = call.HasInput
                                 ? new TypeDescriptorCache().GetPropertiesFor(call.InputType()).Keys
                                 : new string[0];

            Alter(route, call.Method.Name, properties, text => observer.RecordCallStatus(call, text));

            if (call.HasInput)
            {
                route.ApplyInputType(call.InputType());
            }
        }
コード例 #30
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if (!call.Method.HasAttribute<FubuPartialAttribute>()) return false;

            if (log.IsRecording)
            {
                log.RecordCallStatus(call,
                                     "Action '{0}' has the [{1}] defined. This action is only callable via a partial request from another action and cannot be navigated-to or routed-to from the client browser directly."
                                         .ToFormat(call.Method.Name, typeof (FubuPartialAttribute).Name));
            }

            return true;
        }
コード例 #31
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            var result = call.Method.HasAttribute <UrlPatternAttribute>();

            if (result && log.IsRecording)
            {
                log.RecordCallStatus(call,
                                     "Action '{0}' has the [{1}] defined. Using explicitly defined URL pattern."
                                     .ToFormat(call.Method.Name, typeof(UrlPatternAttribute).Name));
            }

            return(result);
        }
コード例 #32
0
        public void Apply(ActionCall call, IRouteDefinition routeDefinition, IConfigurationObserver observer)
        {
            var matchingFilters = _httpMethodFilters.Where(x => x.Filter(call));

            var httpMethods = matchingFilters.Select(x => x.Method).ToArray();

            if (httpMethods.Length > 0)
            {
                routeDefinition.AddRouteConstraint(HTTP_METHOD_CONSTRAINT, new HttpMethodConstraint(httpMethods));
                matchingFilters.Each(filter => observer.RecordCallStatus(call,
                                                                         "Adding route constraint {0} based on filter [{1}]".ToFormat(filter.Method, filter.Description)));
            }
        }
コード例 #33
0
        public void Apply(ActionCall call, IRouteDefinition routeDefinition, IConfigurationObserver observer)
        {
            var matchingFilters = _httpMethodFilters.Where(x => x.Filter(call));

            var httpMethods = matchingFilters.Select(x => x.Method).ToArray();
            if (httpMethods.Length > 0)
            {
                routeDefinition.AddRouteConstraint(HTTP_METHOD_CONSTRAINT, new HttpMethodConstraint(httpMethods));
                matchingFilters.Each(filter => observer.RecordCallStatus(call,
                    "Adding route constraint {0} based on filter [{1}]".ToFormat(filter.Method, filter.Description)));

            }
        }
コード例 #34
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            var result = call.Method.HasAttribute<UrlPatternAttribute>();

            if( result && log.IsRecording )
            {
                log.RecordCallStatus(call,
                    "Action '{0}' has the [{1}] defined. Using explicitly defined URL pattern."
                    .ToFormat(call.Method.Name, typeof(UrlPatternAttribute).Name));
            }

            return result;
        }
コード例 #35
0
        public static void Alter(IRouteDefinition route, ActionCall call, IConfigurationObserver observer)
        {
            var properties = call.HasInput
                                 ? new TypeDescriptorCache().GetPropertiesFor(call.InputType()).Keys
                                 : new string[0];

            Alter(route, call.Method.Name, properties, text => observer.RecordCallStatus(call, text));

            if (call.HasInput)
            {
                route.ApplyInputType(call.InputType());
            }
        }
コード例 #36
0
        private void attachMediaHandling(BehaviorChain chain, IConfigurationObserver observer)
        {
            var firstAction = chain.FirstCall();
            if (firstAction == null) return;

            observer.RecordCallStatus(firstAction, "Meets criteria {0} for Conneg".ToFormat(_description));

            var node = new ConnegNode(){
                InputType = chain.InputType(),
                OutputType = chain.Calls.Where(x => x.HasOutput).Select(x => x.OutputType()).LastOrDefault()
            };

            firstAction.AddBefore(node);
        }
コード例 #37
0
        public bool Matches(ActionCall call, IConfigurationObserver log)
        {
            if (!call.Method.HasAttribute <FubuPartialAttribute>())
            {
                return(false);
            }

            if (log.IsRecording)
            {
                log.RecordCallStatus(call,
                                     "Action '{0}' has the [{1}] defined. This action is only callable via a partial request from another action and cannot be navigated-to or routed-to from the client browser directly."
                                     .ToFormat(call.Method.Name, typeof(FubuPartialAttribute).Name));
            }

            return(true);
        }
コード例 #38
0
ファイル: BehaviorGraph.cs プロジェクト: GunioRobot/fubumvc
        public BehaviorGraph(IConfigurationObserver observer)
        {
            RouteIterator = new SortByRouteRankIterator(); // can override in a registry
            Observer      = observer;

            _chainsForType.OnMissing = findChainsByType;

            _chainsForTypeAndCategory.OnMissing =
                type =>
                new Cache <string, IEnumerable <BehaviorChain> >(
                    category => { return(ChainsFor(type).Where(x => x.UrlCategory.Category == category).ToList()); });

            _chainsForMethod = new Cache <Type, ChainGroup>(type => new ChainGroup(type, this));

            _creators =
                new Cache <Type, BehaviorChain>(
                    type => { return(Behaviors.SingleOrDefault(x => x.UrlCategory.Creates.Contains(type))); });
        }
コード例 #39
0
        private void attachMediaHandling(BehaviorChain chain, IConfigurationObserver observer)
        {
            var firstAction = chain.FirstCall();

            if (firstAction == null)
            {
                return;
            }

            observer.RecordCallStatus(firstAction, "Meets criteria {0} for Conneg".ToFormat(_description));

            var node = new ConnegNode()
            {
                InputType  = chain.InputType(),
                OutputType = chain.Calls.Where(x => x.HasOutput).Select(x => x.OutputType()).LastOrDefault()
            };

            firstAction.AddBefore(node);
        }
コード例 #40
0
        protected override void OnWorkerStart(CancellationToken token)
        {
            IConfigurationObserver obs = null;

            try
            {
                obs = configurationObserverFactory.Invoke();
                obs.PropertyChanged += (o, ea) =>
                {
                    var cfgDto = new ConfigurationDto
                    {
                        Timeout          = obs.DocumentsJoinerConfiguration.Timeout,
                        BarcodeSeparator = obs.DocumentsJoinerConfiguration.BarcodeSeparatorValue
                    };
                    var cmd = new CommandMessage <ConfigurationDto>
                    {
                        CommandName = CommandMessageName.UPDATE_CONFIGURATION_COMMAND_NAME,
                        Payload     = cfgDto
                    };
                    commandsQueue.SendMessage(cmd.Serialize());
                };
                obs.Start();
                while (!token.IsCancellationRequested)
                {
                    token.WaitHandle.WaitOne(SEND_STATUS_COMMAND_PERIOD_MS);
                    if (token.IsCancellationRequested)
                    {
                        break;
                    }

                    var statusCmd = new CommandMessage <object>
                    {
                        CommandName = CommandMessageName.SEND_STATUS_COMMAND_NAME
                    };
                    commandsQueue.SendMessage(statusCmd.Serialize());
                }
            }
            finally
            {
                obs?.Dispose();
            }
        }
コード例 #41
0
        public void BeforeEach()
        {
            _parent = new FubuRegistry();
            _parent.IncludeDiagnostics(true);

            _import = new FubuRegistry();
            _import.IncludeDiagnostics(true);
            _import.Actions
                .IncludeType<Handler1>()
                .IncludeType<Handler2>();

            _import.Configure(x =>
            {
                _importObserver = x.Observer;
                _importActions = x.Actions()
                    .Where(a => a.HandlerType.Namespace == GetType().Namespace);
            });

            _parent.Import(_import, "import");
            _parentObserver = _parent.BuildGraph().Observer;
        }
コード例 #42
0
        public void BeforeEach()
        {
            _parent = new FubuRegistry();
            _parent.IncludeDiagnostics(true);

            _import = new FubuRegistry();
            _import.IncludeDiagnostics(true);
            _import.Actions
            .IncludeType <Handler1>()
            .IncludeType <Handler2>();

            _import.Configure(x =>
            {
                _importObserver = x.Observer;
                _importActions  = x.Actions()
                                  .Where(a => a.HandlerType.Namespace == GetType().Namespace);
            });

            _parent.Import(_import, "import");
            _parentObserver = _parent.BuildGraph().Observer;
        }
コード例 #43
0
 private static void modifyChain(BehaviorChain chain, IConfigurationObserver observer)
 {
     chain.Calls.Each(c => observer.RecordCallStatus(c, "Wrapping with diagnostic tracer and behavior"));
     chain.ToArray().Each(node => node.AddBefore(Wrapper.For<BehaviorTracer>()));
     chain.Prepend(new Wrapper(typeof (DiagnosticBehavior)));
 }
コード例 #44
0
 public bool Matches(ActionCall call, IConfigurationObserver log)
 {
     return call.Method.DeclaringType.Name == DefaultHomeControllerConvention &&
            call.Method.Name == DefaultHomeMethodConvention;
 }
コード例 #45
0
 public BehaviorVisitor(IConfigurationObserver observer, string reasonToVisit)
 {
     _observer = observer;
     _reasonToVisit = reasonToVisit;
 }
コード例 #46
0
 public bool Matches(ActionCall call, IConfigurationObserver log)
 {
     return(call.Method == _method);
 }
コード例 #47
0
ファイル: UrlPolicy.cs プロジェクト: GunioRobot/fubumvc
 public bool Matches(ActionCall call, IConfigurationObserver log)
 {
     return(_filter(call));
 }
コード例 #48
0
 public BehaviorGraph(IConfigurationObserver observer)
 {
     RouteIterator = new SortByRouteRankIterator(); // can override in a registry
     Observer      = observer;
 }
コード例 #49
0
 public ObserverImporter(IConfigurationObserver importingObserver)
 {
     _importingObserver = importingObserver;
 }
コード例 #50
0
 public void Import(IConfigurationObserver import)
 {
     import.RecordedCalls().Each(call => import.GetLog(call)
                                 .Each(log => _importingObserver.RecordCallStatus(call, log)));
 }
コード例 #51
0
 public void Setup()
 {
     _policy   = new DiagnosticsAttributeUrlPolicy();
     _observer = new NulloConfigurationObserver();
 }
コード例 #52
0
 public bool Matches(ActionCall call, IConfigurationObserver log)
 {
     return(call.HandlerType.Closes(typeof(RestfulDeleteHandler <>)));
 }
コード例 #53
0
 public bool Matches(ActionCall call, IConfigurationObserver log)
 {
     return call.HandlerType.Name.EndsWith("Handler");
 }
コード例 #54
0
ファイル: UrlPolicy.cs プロジェクト: joshuaflanagan/fubumvc
 public bool Matches(ActionCall call, IConfigurationObserver log)
 {
     return _filter(call);
 }
コード例 #55
0
 public void UsingObserver(IConfigurationObserver observer)
 {
     _observer = observer;
 }
コード例 #56
0
 public bool Matches(ActionCall call, IConfigurationObserver log)
 {
     return call.HasAttribute<FubuDiagnosticsAttribute>();
 }
コード例 #57
0
 public void Setup()
 {
     _policy = new DiagnosticsHandlerUrlPolicy(typeof(DiagnosticsFeatures));
     _observer = new NulloConfigurationObserver();
 }
コード例 #58
0
 public bool Matches(ActionCall call, IConfigurationObserver log)
 {
     return call.HandlerType == typeof (BehaviorGraphWriter);
 }
コード例 #59
0
 public bool Matches(ActionCall call, IConfigurationObserver log)
 {
     return(call.HandlerType.Closes(typeof(AwesomeEditHandler <>)));
 }
コード例 #60
0
 public bool Matches(ActionCall call, IConfigurationObserver log)
 {
     log.RecordCallStatus(call, "Matched on {0}".ToFormat(GetType().Name));
     return(true);
 }