public void add_type_adds_a_plugin_for_type_once_and_only_once() { var graph = new PluginGraph(); graph.AddType(typeof (IThingy), typeof (BigThingy)); PluginFamily family = graph.FindFamily(typeof (IThingy)); family.InstanceCount.ShouldEqual(1); graph.AddType(typeof (IThingy), typeof (BigThingy)); family.InstanceCount.ShouldEqual(1); }
public void Process(Type type, PluginGraph graph) { if (!IsConcrete(type)) return; if (type.Name.EndsWith("Actor") && type.Implements<AsyncHttpActor>()) graph.AddType(typeof(AsyncHttpActor), type); }
public void Process(Type type, PluginGraph graph) { Type interfaceType = type.FindInterfaceThatCloses(typeof(IHbmWriter<>)); if (interfaceType != null) { graph.AddType(interfaceType, type); } }
public void Process(Type type, PluginGraph graph) { if(!IsConcrete(type)) return; Type pluginType = FindPluginType(type); if(pluginType != null && Constructor.HasConstructors(type)) { graph.AddType(pluginType, type); //var family = graph.FindFamily(type); //family.AddType(pluginType, pluginType.AssemblyQualifiedName); //family.SetScopeTo(_instanceScope); } }
public void Process(Type type, PluginGraph graph) { if (typeof (IEndpoint).IsAssignableFrom(type)) { graph.AddType(type); TransportTypes.Add(type); } }