public void Setup()
        {
            var types = new TypePool();
            types.AddAssembly(GetType().Assembly);

            _runner = new ViewEngineSettings();
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            var pool = new TypePool();
            pool.AddAssembly(Assembly.GetExecutingAssembly());

            views = new WebFormViewFacility().FindViews(pool);
        }
        public void SetUp()
        {
            var pool = new TypePool(null){
                ShouldScanAssemblies = true
            };
            pool.AddAssembly(Assembly.GetExecutingAssembly());

            views = new WebFormViewFacility().FindViews(pool, new BehaviorGraph());
        }
Exemplo n.º 4
0
        public TypePool Types()
        {
            var types = new TypePool();

            if (ApplicationAssembly != null)
            {
                types.AddAssembly(ApplicationAssembly);
            }
            types.AddAssemblies(PackageRegistry.PackageAssemblies);

            return(types);
        }
Exemplo n.º 5
0
        private static TypePool getTypes()
        {
            var types = new TypePool();
            types.AddAssembly(TypePool.FindTheCallingAssembly());

            var filter = new CompositeFilter<Assembly>();
            filter.Excludes.Add(a => a.IsDynamic);
            filter.Excludes.Add(a => types.HasAssembly(a));
            filter.Includes += (t => true);

            types.AddSource(() => AppDomain.CurrentDomain.GetAssemblies().Where(filter.MatchesAll));

            return types;
        }
Exemplo n.º 6
0
        public void Configure(BehaviorGraph graph)
        {
            var rules = graph.Settings.Get <AccessorRules>();

            var types = new TypePool();

            types.AddAssembly(graph.ApplicationAssembly);
            types.AddAssemblies(PackageRegistry.PackageAssemblies);

            types.TypesMatching(x => x.CanBeCastTo <IAccessorRulesRegistration>() && x.IsConcreteWithDefaultCtor()).
            Distinct().Select(x => {
                return(Activator.CreateInstance(x).As <IAccessorRulesRegistration>());
            })
            .Each(x => x.AddRules(rules));

            graph.Services.AddService(rules);
        }
        public IEnumerable<ActionCall> FindActions(Assembly applicationAssembly)
        {
            var types = new TypePool();
            types.AddAssembly(applicationAssembly);

            var methodName = ReflectionHelper.GetMethod<ChannelWriter<Topic>>(x => x.Write(null))
                .Name;

            var topicTypes = types.TypesMatching(x => x.IsConcreteTypeOf<Topic>());

            foreach (var topicType in topicTypes)
            {
                var handlerType = typeof (ChannelWriter<>).MakeGenericType(topicType);
                var method = handlerType.GetMethod(methodName);

                yield return new ActionCall(handlerType, method);
            }
        }