public void Setup() { var types = new TypePool(); types.AddAssembly(GetType().Assembly); _runner = new ViewEngineSettings(); }
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()); }
public TypePool Types() { var types = new TypePool(); if (ApplicationAssembly != null) { types.AddAssembly(ApplicationAssembly); } types.AddAssemblies(PackageRegistry.PackageAssemblies); return(types); }
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; }
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); } }