Esempio n. 1
0
        public Task <BehaviorChain[]> BuildChains(BehaviorGraph graph, IPerfTimer timer)
        {
            var finders = HandlerSources.Select(x => x.FindCalls(graph.ApplicationAssembly)).ToArray();

            return(Task.WhenAll(finders).ContinueWith(all =>
            {
                var handlers = new HandlerGraph();

                var allCalls = all.Result.SelectMany(x => x).Distinct();

                handlers.Add(allCalls);

                handlers.Compile();

                return handlers.OfType <BehaviorChain>().ToArray();
            }));
        }
Esempio n. 2
0
        public void Import(HandlerGraph other)
        {
            _stagedCalls.Fill(other._stagedCalls);

            other._chains.Values.Each(chain => {
                var inputType = chain.InputType();
                if (_chains.ContainsKey(inputType))
                {
                    var original = _chains[inputType];

                    chain.ToArray().Each(original.AddToEnd);
                }
                else
                {
                    _chains.Add(inputType, chain);
                }
            });
        }