/// <summary> /// Scans current app domain and attempts to register all classes and interfaces /// in the specified namespace. /// </summary> /// <param name="inNamespace"></param> public AutoTypeContainer(string inNamespace, IRegisterTypes types, ICreateInstances instances) : base(types, instances) { AutoTypeDiscoverer discoverer = new AutoTypeDiscoverer(this, inNamespace); discoverer.Scan(); }
/// <summary> /// Constructor specifying type registry and instance creator. /// </summary> public TypeContainer(IRegisterTypes types, ICreateInstances instances) { this.typeRegistry = types ?? new SimpleTypeRegistry(); this.instanceCreator = instances ?? new SimpleInstanceCreator(); }
protected override void RegisterTypes(IRegisterTypes typeRegistration) { this.registeredInstance = new DummyServiceImplementation(); typeRegistration.Register <DummyServiceImplementation, IAmAServiceDummy>(this.registeredInstance); }
/// <summary> /// Registers all types needed by the SUT at a central registration or container. /// </summary> /// <param name="typeRegistration"> /// Instance which shall contain the registered types. /// </param> protected virtual void RegisterTypes(IRegisterTypes typeRegistration) { }
internal void Initialize() { TypeRegistry = typeStoreFactory.GetTypeRegistry(); TypeResolver = typeStoreFactory.GetTypeResolver(); }
protected override void RegisterTypes(IRegisterTypes typeRegistration) { typeRegistration.Register <DummyServiceImplementation, IAmAServiceDummy>(); }
protected override void RegisterTypes(IRegisterTypes typeRegistration) { this.DataOfRegisterTypes = this.Data; base.RegisterTypes(typeRegistration); }
/// <summary> /// Registers default types at the given registry. /// </summary> /// <param name="typeRegistry">The type registry at which to register default types.</param> public void Register(IRegisterTypes typeRegistry) { typeRegistry.Register <TSource, TTarget>(); }
/// <summary> /// Constructor taking type registry to do dependency resolution. /// </summary> /// <param name="registry"></param> public ResolvingInstanceCreator(IRegisterTypes registry) { this._typeRegistry = registry; }