public static ConnegGraph Build(BehaviorGraph behaviorGraph) { var graph = new ConnegGraph(); TypePool typePool = behaviorGraph.Types(); var writers = typePool .TypesMatching( x => x.Closes(typeof (IMediaWriter<>)) && x.IsConcreteWithDefaultCtor() && !x.IsOpenGeneric()); graph.Writers.AddRange(writers); var readers = typePool .TypesMatching( x => x.Closes(typeof (IReader<>)) && x.IsConcreteWithDefaultCtor() && !x.IsOpenGeneric()); graph.Readers.AddRange(readers); return graph; }
public static ConnegGraph Build(BehaviorGraph behaviorGraph) { var graph = new ConnegGraph(); TypePool typePool = behaviorGraph.Types(); var writers = typePool .TypesMatching( x => x.Closes(typeof(IMediaWriter <>)) && x.IsConcreteWithDefaultCtor() && !x.IsOpenGeneric()); graph.Writers.AddRange(writers); var readers = typePool .TypesMatching( x => x.Closes(typeof(IReader <>)) && x.IsConcreteWithDefaultCtor() && !x.IsOpenGeneric()); graph.Readers.AddRange(readers); return(graph); }
public static void Compile(BehaviorGraph graph) { graph.Settings.Replace(() => { return PackageRegistry.Timer.Record("Finding AccessorRules", () => { var rules = new AccessorRules(); graph.Types() .TypesMatching( x => x.CanBeCastTo<IAccessorRulesRegistration>() && x.IsConcreteWithDefaultCtor() && !x.IsOpenGeneric()) . Distinct().Select(x => Activator.CreateInstance(x).As<IAccessorRulesRegistration>()) .Each(x => x.AddRules(rules)); return rules; }); }); }
public ViewTypePool(BehaviorGraph graph) { _graph = graph; _types = graph.Types(); }
public ViewTypePool(BehaviorGraph graph) { _graph = graph; _types = graph.Types(); }