Ejemplo n.º 1
0
        public static DependencyScanner GetDependencyScanner(DependencyScanTarget dependencyScanTarget, Assembly assembly, string currentNamespace)
        {
            switch (dependencyScanTarget)
            {
            case DependencyScanTarget.CurrentNamespace:
                return(new NamespaceScanner(assembly, currentNamespace));

            case DependencyScanTarget.CurrentNamespaceRecursive:
                return(new NamespaceRecursiveScanner(assembly, currentNamespace));

            case DependencyScanTarget.Assembly:
                return(new AssemblyScanner(assembly));

            default:
                return(null);
            }
        }
Ejemplo n.º 2
0
 protected DIContext(Type callingType, DependencyScanTarget scanTarget) : this(callingType)
 {
     this._scanTarget = scanTarget;
 }
Ejemplo n.º 3
0
 public AttributeBasedDIContext(Type callingType, DependencyScanTarget scanTarget) : base(callingType, scanTarget)
 {
     this.Scanner   = DependencyScanner.GetDependencyScanner(this._scanTarget, this._callingAssembly, this._currentNamespace);
     this.Registrar = DependencyRegistrar.BuildRegistrarChain(this._container);
 }