public DatabaseInitializer(ILifetimeScope scope, ITypeScanner typeScanner, SmartConfiguration appConfig) { _scope = scope; _appConfig = appConfig; _typeScanner = typeScanner; _seedersMap = DiscoverDataSeeders().ToMultimap(key => key.ContextType, value => value.SeederType); }
public static ITypeScanner For <TConvention>(this ITypeScanner scanner) where TConvention : IConvention, new() { Guard.IsNotNull(scanner, "scanner"); scanner.AddConvention(new TConvention()); return(scanner); }
public InstallPermissionsInitializer(SmartDbContext db, /* IPermissionService permissionService,*/ ITypeScanner typeScanner) { // TODO: (core) Resolving IPermissionService in initializer throws. Why? Investigate, _db = db; //_permissionService = permissionService; _typeScanner = typeScanner; }
public override void SetUp() { base.SetUp(); typeScanner = new DefaultTypeScanner( new ModuleCatalog(), NullLogger.Instance, typeof(TypeScannerBase).Assembly); }
public RootApplicationInitializer( IComponentContext scope, ITypeScanner typeScanner, ILogger <RootApplicationInitializer> logger) { _scope = scope; _typeScanner = typeScanner; _logger = logger; }
internal void AddTypeScanner(ITypeScanner typeScanner) { if (typeScanner == null) { throw new ArgumentNullException("typeScanner"); } if (!_typeScanners.Contains(typeScanner)) { _typeScanners.Add(typeScanner); } }
/// <summary> /// Adds a scanner to the configurator. /// </summary> /// <param name="scanner">An <see cref="ITypeScanner"/> instance to add.</param> /// <returns>A reference to the current <see cref="ITypeScannerConfigurator"/> instance.</returns> public ITypeScannerConfigurator Scanner(ITypeScanner scanner) { if (scanner == null) { throw new ArgumentNullException("scanner", "The scanner argument cannot be null."); } this.InternalTypeScanner.Add(scanner); return this; }
public void With <T>() where T : ITypeScanner, new() { _scanners.RemoveAll(scanner => scanner is T); ITypeScanner previous = _scanners.FirstOrDefault(scanner => scanner is T); if (previous == null) { With(new T()); } }
/// <summary> /// Adds a scanner to the configurator. /// </summary> /// <param name="scanner">An <see cref="ITypeScanner"/> instance to add.</param> /// <returns>A reference to the current <see cref="ITypeScannerConfigurator"/> instance.</returns> public ITypeScannerConfigurator Scanner(ITypeScanner scanner) { if (scanner == null) { throw new ArgumentNullException("scanner", "The scanner argument cannot be null."); } this.InternalTypeScanner.Add(scanner); return(this); }
/// <summary> /// Adds an <see cref="ITypeScanner"/> instance to the aggregate scanner. /// </summary> /// <param name="scanner">The <see cref="ITypeScanner"/> instance to add to the aggregate scanner.</param> /// <exception cref="ArgumentNullException">The value of the <paramref name="scanner"/> parameter cannot be <see langword="null"/>.</exception> public void Add(ITypeScanner scanner) { if (scanner == null) { throw new ArgumentNullException("scanner", "The value of the scanner parameter cannot be null."); } lock (this.instanceLock) { this.Scanners.Add(scanner); } }
/// <summary> /// Adds an <see cref="ITypeScanner"/> instance to the aggregate scanner. /// </summary> /// <param name="scanner">The <see cref="ITypeScanner"/> instance to add to the aggregate scanner.</param> /// <exception cref="ArgumentNullException">The value of the <paramref name="scanner"/> parameter cannot be <see langword="null"/>.</exception> public void Add(ITypeScanner scanner) { if (scanner == null) { throw new ArgumentNullException("scanner", "The value of the scanner parameter cannot be null."); } lock(this.instanceLock) { this.Scanners.Add(scanner); } }
/// <summary> /// Scans the specified closure. /// </summary> /// <param name="closure">The closure.</param> public void Scan(Action <ITypeScannerConfigurator> closure) { if (closure == null) { throw new ArgumentNullException("closure", "The closure cannot be null."); } var configurator = new TypeScannerConfigurator(); closure.Invoke(configurator); this.TypeScanner = configurator.GetTypeScanner(); }
public TimedTypeScanner( IDiagnosticReporter diagnosticReporter, ITypeScanner typeScanner ) { if (diagnosticReporter is null) { throw new ArgumentNullException(nameof(diagnosticReporter)); } if (typeScanner is null) { throw new ArgumentNullException(nameof(typeScanner)); } _diagnosticReporter = diagnosticReporter; _typeScanner = typeScanner; }
public InstallPermissionsInitializer(SmartDbContext db, IPermissionService permissionService, ITypeScanner typeScanner) { _db = db; _permissionService = permissionService; _typeScanner = typeScanner; }
public void With(ITypeScanner typeScanner) { _scanners.Add(typeScanner); }
/// <summary> /// Find all types that are subclasses of <typeparamref name="T"/> in all known assemblies. /// </summary> /// <typeparam name="T">The base type to check for</typeparam> /// <param name="concreteTypesOnly">Whether abstract types should be skipped.</param> /// <param name="ignoreInactiveModules">Speciifies whether inactive module's assemblies should be ignored.</param> /// <returns>Matching types</returns> public static IEnumerable <Type> FindTypes <T>(this ITypeScanner scanner, bool concreteTypesOnly = true, bool ignoreInactiveModules = false) { return(scanner.FindTypes(typeof(T), concreteTypesOnly, ignoreInactiveModules)); }
/// <summary> /// Find all types that are subclasses of <typeparamref name="T"/> in all passed <paramref name="assemblies"/>. /// </summary> /// <param name="baseType">The base type to check for.</param> /// <param name="concreteTypesOnly">Whether abstract types should be skipped.</param> /// <param name="assemblies">Assemblies to scan.</param> /// <returns>Matching types</returns> public static IEnumerable <Type> FindTypes <T>(this ITypeScanner scanner, IEnumerable <Assembly> assemblies, bool concreteTypesOnly = true) { return(scanner.FindTypes(typeof(T), assemblies, concreteTypesOnly)); }
public void With(ITypeScanner typeScanner) { Context.AddTypeScanner(typeScanner); }
public void With(ITypeScanner scanner) { _scanners.Fill(scanner); }
public MenuPublisher(ITypeScanner typeScanner, IRequestCache requestCache) { _typeScanner = typeScanner; _requestCache = requestCache; }
internal void AddTypeScanner(ITypeScanner typeScanner) { if (typeScanner == null) throw new ArgumentNullException("typeScanner"); if (!_typeScanners.Contains(typeScanner)) _typeScanners.Add(typeScanner); }