コード例 #1
0
        /// <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();
        }
コード例 #2
0
ファイル: TypeContainer.cs プロジェクト: deejaygraham/brioche
 /// <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);
 }
コード例 #4
0
 /// <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)
 {
 }
コード例 #5
0
 internal void Initialize()
 {
     TypeRegistry = typeStoreFactory.GetTypeRegistry();
     TypeResolver = typeStoreFactory.GetTypeResolver();
 }
コード例 #6
0
 protected override void RegisterTypes(IRegisterTypes typeRegistration)
 {
     typeRegistration.Register <DummyServiceImplementation, IAmAServiceDummy>();
 }
 protected override void RegisterTypes(IRegisterTypes typeRegistration)
 {
     this.DataOfRegisterTypes = this.Data;
     base.RegisterTypes(typeRegistration);
 }
コード例 #8
0
 /// <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>();
 }
コード例 #9
0
 /// <summary>
 /// Constructor taking type registry to do dependency resolution.
 /// </summary>
 /// <param name="registry"></param>
 public ResolvingInstanceCreator(IRegisterTypes registry)
 {
     this._typeRegistry = registry;
 }