public MessagingConfiguration ResolveReferencesWith(IIocResolver container) { Contract.Requires(container != null); ExternalResolver = container; return this; }
/// <inheritdoc/> public virtual void Initialize(ILocalizationConfiguration configuration, IIocResolver iocResolver) { _configuration = configuration; _iocResolver = iocResolver; if (_dictionaryProvider == null) { return; } var defaultProvided = false; foreach (var dictionaryInfo in _dictionaryProvider.GetDictionaries(Name)) { _dictionaries[dictionaryInfo.Dictionary.CultureInfo.Name] = dictionaryInfo.Dictionary; if (dictionaryInfo.IsDefault) { if (defaultProvided) { throw new AbpInitializationException("Only one default localization dictionary can be for source: " + Name); } _defaultDictionary = dictionaryInfo.Dictionary; defaultProvided = true; } } if (!defaultProvided) { throw new AbpInitializationException("There should be a default localization dictionary for source: " + Name); } }
/// <summary> /// Constructor. /// </summary> public LocalizationManager(ILocalizationConfiguration configuration, IIocResolver iocResolver) { Logger = NullLogger.Instance; _configuration = configuration; _iocResolver = iocResolver; _sources = new Dictionary<string, ILocalizationSource>(); }
/// <summary> /// Creates a new <see cref="MethodInvocationValidator"/> instance. /// </summary> public MethodInvocationValidator(IValidationConfiguration configuration, IIocResolver iocResolver) { _configuration = configuration; _iocResolver = iocResolver; ValidationErrors = new List<ValidationResult>(); ObjectsToBeNormalized = new List<IShouldNormalize>(); }
public DynamicNavigationManager( IIocResolver iocResolver, INavigationManager navigationManager, INavigationConfiguration navigationConfiguration) { _iocResolver = iocResolver; _navigationManager = navigationManager; _navigationConfiguration = navigationConfiguration; }
/// <summary> /// 构建服务并设置本地程序平台的Resolver /// </summary> /// <param name="services">服务映射信息集合</param> /// <param name="assemblies">要检索的程序集集合</param> /// <returns>服务提供者</returns> protected override IServiceProvider BuildAndSetResolver(IServiceCollection services, Assembly[] assemblies) { ContainerBuilder builder = new ContainerBuilder(); builder.Populate(services); IContainer container = builder.Build(); LocalIocResolver.Container = container; Resolver = container.Resolve<IIocResolver>(); return Resolver.Resolve<IServiceProvider>(); }
public HangfireIocJobActivator(IIocResolver iocResolver) { if (iocResolver == null) { throw new ArgumentNullException(nameof(iocResolver)); } _iocResolver = iocResolver; }
/// <summary> /// Initializes new instance of WindsorJobActivator with a Windsor Kernel /// </summary> public WindsorJobActivator(IIocResolver iocResolver) { if (iocResolver == null) { throw new ArgumentNullException("iocResolver"); } _iocResolver = iocResolver; }
public override void Initialize(ILocalizationConfiguration configuration, IIocResolver iocResolver) { base.Initialize(configuration, iocResolver); if (Logger is NullLogger && iocResolver.IsRegistered(typeof(ILoggerFactory))) { Logger = iocResolver.Resolve<ILoggerFactory>().Create(typeof (MultiTenantLocalizationSource)); } }
public UnitOfWorkManager( IIocResolver iocResolver, ICurrentUnitOfWorkProvider currentUnitOfWorkProvider, IUnitOfWorkDefaultOptions defaultOptions) { _iocResolver = iocResolver; _currentUnitOfWorkProvider = currentUnitOfWorkProvider; _defaultOptions = defaultOptions; }
public NavigationManager(IIocResolver iocResolver, INavigationConfiguration configuration) { _iocResolver = iocResolver; _configuration = configuration; Menus = new Dictionary<string, MenuDefinition> { {"MainMenu", new MenuDefinition("MainMenu", new FixedLocalizableString("Main menu"))} //TODO: Localization for "Main menu" }; }
public ApiProxyScriptManager( IApiDescriptionModelProvider modelProvider, IApiProxyScriptingConfiguration configuration, IIocResolver iocResolver) { _modelProvider = modelProvider; _configuration = configuration; _iocResolver = iocResolver; _cache = new ConcurrentDictionary<string, string>(); }
//private readonly IFeatureDependencyContext _featureDependencyContext; //public UserNavigationManager( // INavigationManager navigationManager, // IFeatureDependencyContext featureDependencyContext) //{ // _navigationManager = navigationManager; // _featureDependencyContext = featureDependencyContext; // PermissionChecker = NullPermissionChecker.Instance; // AbpSession = NullAbpSession.Instance; //} /// <summary> /// 构造函数 /// </summary> /// <param name="navigationManager">导航管理器</param> /// <param name="localizationContext">本地化上下文</param> /// <param name="iocResolver">Ioc解析</param> public UserNavigationManager( INavigationManager navigationManager, ILocalizationContext localizationContext, IIocResolver iocResolver) { _navigationManager = navigationManager; _localizationContext = localizationContext; _iocResolver = iocResolver; PermissionChecker = NullPermissionChecker.Instance; AbpSession = NullAbpSession.Instance; }
private static string GetNameOrConnectionStringOrNull(IIocResolver iocResolver) { //if (iocResolver.IsRegistered<IBdfStartupConfiguration>()) //{ // var defaultConnectionString = iocResolver.Resolve<IBdfStartupConfiguration>().DefaultNameOrConnectionString; // if (!string.IsNullOrWhiteSpace(defaultConnectionString)) // { // return defaultConnectionString; // } //} return ConfigurationManager.ConnectionStrings["Default"] != null ? "Default" : null; }
/// <summary> /// 获取链接字符串名称,或者null /// </summary> /// <param name="iocResolver">IOC控制反转解析器</param> /// <returns></returns> private static string GetNameOrConnectionStringOrNull(IIocResolver iocResolver) { if (iocResolver.IsRegistered<IAbpStartupConfiguration>()) { var defaultConnectionString = iocResolver.Resolve<IAbpStartupConfiguration>().DefaultNameOrConnectionString; if (!string.IsNullOrWhiteSpace(defaultConnectionString)) { return defaultConnectionString; } } if (ConfigurationManager.ConnectionStrings["Default"] != null) { return "Default"; } return null; }
private static void ConfigureMvc(IServiceCollection services, IIocResolver iocResolver) { //See https://github.com/aspnet/Mvc/issues/3936 to know why we added these services. services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>(); //Use DI to create controllers services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>()); //Add feature providers var partManager = services.GetSingletonServiceOrNull<ApplicationPartManager>(); partManager.FeatureProviders.Add(new AbpAppServiceControllerFeatureProvider(iocResolver)); //Configure JSON serializer services.Configure<MvcJsonOptions>(jsonOptions => { jsonOptions.SerializerSettings.Converters.Insert(0, new AbpDateTimeConverter()); }); }
/// <summary> /// Creates a new instance of WindsorControllerFactory. /// </summary> /// <param name="iocManager">Reference to DI kernel</param> public MyDefaultControllerFactory(IIocResolver iocManager) { _iocManager = iocManager; }
public UserMemberManager(IRepository <UserMember, long> userMemberRepository, IIocResolver iocResolver, IRepository <UserMemberLessonMind, long> userMemberLessonMindRepository) { _userMemberRepository = userMemberRepository; _iocResolver = iocResolver; //var personService1 = _iocResolver.Resolve<IRepository<LessonMind>>(); _userMemberLessonMindRepository = userMemberLessonMindRepository; }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <AbpCoreDemoDbContext>(iocResolver, SeedHostDb); }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <OSMSDbContext>(iocResolver, SeedHostDb); }
public MessagingConfiguration() { BuildActions = new List<Action>(); ExternalResolver = GetInternalIocContainer(); }
public EventBusInstaller(IIocResolver iocResolver) { _iocResolver = iocResolver; _eventBusConfiguration = iocResolver.Resolve<IEventBusConfiguration>(); }
public DeleteHandlerFactory(IIocResolver iocResolver) { _iocResolver = iocResolver; }
/// <summary> /// Gets an <see cref="DisposableDependencyObjectWrapper{T}"/> object that wraps resolved object to be Disposable. /// </summary> /// <param name="iocResolver">IIocResolver object</param> /// <param name="type">Type of the object to resolve. This type must be convertible to <see cref="IDisposable"/>.</param> /// <param name="argumentsAsAnonymousType">Constructor arguments</param> /// <returns>The instance object wrapped by <see cref="DisposableDependencyObjectWrapper{T}"/></returns> public static IDisposableDependencyObjectWrapper ResolveAsDisposable(this IIocResolver iocResolver, Type type, object argumentsAsAnonymousType) { return(new DisposableDependencyObjectWrapper(iocResolver, iocResolver.Resolve(type, argumentsAsAnonymousType))); }
public PaymentGatewayStore(IIocResolver iocResolver) { _iocResolver = iocResolver; }
/// <summary> /// Gets an <see cref="DisposableDependencyObjectWrapper{T}"/> object that wraps resolved object to be Disposable. /// </summary> /// <param name="iocResolver">IIocResolver object</param> /// <param name="type">Type of the object to resolve. This type must be convertible to <see cref="IDisposable"/>.</param> /// <returns>The instance object wrapped by <see cref="DisposableDependencyObjectWrapper{T}"/></returns> public static IDisposableDependencyObjectWrapper ResolveAsDisposable(this IIocResolver iocResolver, Type type) { return(new DisposableDependencyObjectWrapper(iocResolver, iocResolver.Resolve(type))); }
/// <summary> /// Gets an <see cref="DisposableDependencyObjectWrapper{T}"/> object that wraps resolved object to be Disposable. /// </summary> /// <typeparam name="T">Type of the object to get</typeparam> /// <param name="iocResolver">IIocResolver object</param> /// <param name="argumentsAsAnonymousType">Constructor arguments</param> /// <returns>The instance object wrapped by <see cref="DisposableDependencyObjectWrapper{T}"/></returns> public static IDisposableDependencyObjectWrapper <T> ResolveAsDisposable <T>(this IIocResolver iocResolver, object argumentsAsAnonymousType) { return(new DisposableDependencyObjectWrapper <T>(iocResolver, iocResolver.Resolve <T>(argumentsAsAnonymousType))); }
/// <summary> /// Gets an <see cref="DisposableDependencyObjectWrapper{T}"/> object that wraps resolved object to be Disposable. /// </summary> /// <typeparam name="T">Type of the object to get</typeparam> /// <param name="iocResolver">IIocResolver object</param> /// <returns>The instance object wrapped by <see cref="DisposableDependencyObjectWrapper{T}"/></returns> public static IDisposableDependencyObjectWrapper <T> ResolveAsDisposable <T>(this IIocResolver iocResolver) { return(new DisposableDependencyObjectWrapper <T>(iocResolver, iocResolver.Resolve <T>())); }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <EdwardAbpDbContext>(iocResolver, SeedHostDb); }
public ApiControllerActivator(IIocResolver iocResolver) { this.iocResolver = iocResolver; }
/// <summary> /// Initializes a new instance of the <see cref="FeatureInterceptor"/> class. /// </summary> /// <param name="iocResolver">The ioc resolver.</param> public FeatureInterceptor(IIocResolver iocResolver) { _iocResolver = iocResolver; }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <LearningABPDbContext>(iocResolver, SeedHostDb); }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <TestProjectDbContext>(iocResolver, SeedHostDb); }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <EventCloudDbContext>(iocResolver, SeedHostDb); }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <CMS_BoilerplateDbContext>(iocResolver, SeedHostDb); }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <AgEmailSenderDbContext>(iocResolver, SeedHostDb); }
/// <inheritdoc/> public virtual void Initialize(ILocalizationConfiguration configuration, IIocResolver iocResolver) { _configuration = configuration; _dictionaryProvider.Initialize(Name); }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <WorkflowDemoDbContext>(iocResolver, SeedHostDb); }
public AbpQuartzWindsorFactory(IIocResolver iocResolver) { _iocResolver = iocResolver; }
/// <summary> /// Creates a new instance of <see cref="IocHandlerFactory"/> class. /// 创建一个新实例的 <see cref="IocHandlerFactory"/> 类。 /// </summary> /// <param name="iocResolver"></param> /// <param name="handlerType">Type of the handler</param> public IocHandlerFactory(IIocResolver iocResolver, Type handlerType) { _iocResolver = iocResolver; HandlerType = handlerType; }
/// <summary> /// 获取对象并自动释放 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="iocResolver"></param> /// <param name="action"></param> public static void Using <T>(this IIocResolver iocResolver, Action <T> action) { using (var wrapper = new DisposableDependencyObjectWrapper <T>(iocResolver, iocResolver.Resolve <T>())) { action(wrapper.Object); } }
/// <summary> /// Creates a new instance of WindsorControllerFactory. /// </summary> /// <param name="iocManager">Reference to DI kernel</param> public WindsorControllerFactory(IIocResolver iocManager) { _iocManager = iocManager; }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <MyPhoneBookDbContext>(iocResolver, SeedHostDb); }
/// <summary> /// This method is called by ABP before first usage. /// </summary> public virtual void Initialize(ILocalizationConfiguration configuration, IIocResolver iocResolver) { _configuration = configuration; }
/// <summary> /// Initializes a new instance of the <see cref="BackgroundWorkerManager"/> class. /// </summary> public BackgroundWorkerManager(IIocResolver iocResolver) { _iocResolver = iocResolver; _backgroundJobs = new List<IBackgroundWorker>(); }
private readonly IIocResolver _iocResolver; //Just for injection testing public AppFeatureProvider(IIocResolver iocResolver) { _iocResolver = iocResolver; }
public AbpHangfireAuthorizationFilter(string requiredPermissionName = null) { _requiredPermissionName = requiredPermissionName; IocResolver = IocManager.Instance; }
/// <inheritdoc/> public virtual void Initialize(ILocalizationConfiguration configuration, IIocResolver iocResolver) { _configuration = configuration; _dictionaryProvider.Initialize(Name); }
public ExternalAuthManager(IIocResolver iocResolver, IExternalAuthConfiguration externalAuthConfiguration) { _iocResolver = iocResolver; _externalAuthConfiguration = externalAuthConfiguration; }
/// <summary> /// Creates a new instance of <see cref="IocHandlerFactory"/> class. /// </summary> /// <param name="iocResolver"></param> /// <param name="handlerType">Type of the handler</param> public IocHandlerFactory(IIocResolver iocResolver, Type handlerType) { _iocResolver = iocResolver; HandlerType = handlerType; }
public AuthorizationInterceptor(IIocResolver iocResolver) { _iocResolver = iocResolver; }
public AccountManageDbMigrator(IUnitOfWorkManager unitOfWorkManager , IAbpStartupConfiguration abpStartupConfiguration , IIocResolver iocResolver) : base(unitOfWorkManager, abpStartupConfiguration, iocResolver) { }
/// <summary> /// Creates a new instance of WindsorControllerFactory. /// </summary> /// <param name="iocManager">Reference to DI kernel</param> public WindsorControllerFactory(IIocResolver iocManager) { _iocManager = iocManager; }
public AuthorizationInterceptor(IIocResolver iocResolver) { _iocResolver = iocResolver; }
public WorkflowInstaller(IIocResolver iocResolver) { _iocResolver = iocResolver; }
public EmbeddedResourceViewFileProvider(IIocResolver iocResolver) : base(iocResolver) { }
/// <summary> /// 构造函数 /// </summary> /// <param name="configuration"></param> /// <param name="iocResolver"></param> public WebApiActionInvocationValidator(IValidationConfiguration configuration, IIocResolver iocResolver) : base(configuration, iocResolver) { }
public DisposableDependencyObjectWrapper(IIocResolver iocResolver, object obj) : base(iocResolver, obj) { }
public void Initialize(ILocalizationConfiguration configuration, IIocResolver iocResolver) { }
public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext <WowBlogerDbContext>(iocResolver, SeedHostDb); }