Example #1
0
        // TODO -- This really needs to change to returning an IEnumerable and
        // we possibly need an alternative that finds by category
        public BehaviorChain Find <T>(Expression <Action <T> > expression)
        {
            var chain = _behaviorGraph.ChainsFor(typeof(T), ReflectionHelper.GetMethod(expression)).SingleOrDefault();

            if (chain == null)
            {
                throw new FubuException(2108, "No behavior chain registered for {0}.{1}()", typeof(T).FullName, ReflectionHelper.GetMethod(expression).Name);
            }

            return(chain);
        }