Example #1
0
        public void Configure(BehaviorGraph graph)
        {
            var pool = TypePool.AppDomainTypes();

            pool.TypesMatching(type => type.IsConcreteTypeOf <ISendMessages>()).Each(type => {
                type.GetMethods(BindingFlags.Public | BindingFlags.Instance)
                .Where(ActionSource.IsCandidate)
                .Each(method => {
                    var transform = new ActionCall(type, method);
                    var chain     = new BehaviorChain();
                    chain.AddToEnd(transform);

                    graph.AddChain(chain);
                });
            });
        }
Example #2
0
        public IEnumerable <ActionCall> FindActions(Assembly applicationAssembly)
        {
            var pool  = TypePool.AppDomainTypes();
            var types = pool.TypesMatching(type => type.IsConcreteTypeOf <ISendMessages>());

            foreach (var type in types)
            {
                var methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance)
                              .Where(ActionSource.IsCandidate);

                foreach (var method in methods)
                {
                    yield return(new ActionCall(type, method));
                }
            }
        }
 public virtual TypePool Types()
 {
     return(TypePool.AppDomainTypes());
 }