public void RegisterRepositories(IDependencyContainer depCon) { var studentRepoBuilder = new Func <object[], object>((parameters) => { return(new StudentsRepository(GetDbConstructor())); }); var subjectsRepoBuilder = new Func <object[], object>((parameters) => { return(new EfCoreRepository <Subject>(GetDbConstructor())); }); var examsRepoBuilder = new Func <object[], object>((parameters) => { return(new EfCoreRepository <Exam>(GetDbConstructor())); }); var studentsExamsRepoBuilder = new Func <object[], object>((parameters) => { return(new EfCoreRepository <StudentExam>(GetDbConstructor())); }); depCon.Register <IRepository <Student>, StudentsRepository>(studentRepoBuilder); depCon.Register <IStudentsRepository, StudentsRepository>((parameters) => new StudentsRepository(GetDbConstructor())); depCon.Register <IRepository <Subject>, EfCoreRepository <Subject> >(subjectsRepoBuilder); depCon.Register <IRepository <Exam>, EfCoreRepository <Exam> >(examsRepoBuilder); depCon.Register <IRepository <StudentExam>, EfCoreRepository <StudentExam> >(studentsExamsRepoBuilder); }
public void RegisterRepositories(IDependencyContainer depCon) { var subjectsRepoBuilder = new Func <object[], object>((parameters) => { return(new GenericRepository <Subjects>(GetDbConstructor())); }); var examsRepoBuilder = new Func <object[], object>((parameters) => { return(new GenericRepository <Exams>(GetDbConstructor())); }); var studentsRepoBuilder = new Func <object[], object>((parameters) => { return(new GenericRepository <Students>(GetDbConstructor())); }); var coursesRepoBuilder = new Func <object[], object>((parameters) => { return(new GenericRepository <Courses>(GetDbConstructor())); }); depCon.Register <IRepository <Students>, GenericRepository <Students> >(studentsRepoBuilder); depCon.Register <IRepository <Subjects>, GenericRepository <Subjects> >(subjectsRepoBuilder); depCon.Register <IRepository <Exams>, GenericRepository <Exams> >(examsRepoBuilder); depCon.Register <IRepository <Courses>, GenericRepository <Courses> >(coursesRepoBuilder); }
public static void ContainerConfig(IDependencyContainer container) { var config = new Config(); container.Register <IObjectConstructionTask, UnityConstruction>(); // config.EnableCaching = false; container.Register(new SitecoreInstaller(config)); }
public void Register(IDependencyContainer container) { container.Register <ICardServiceExcel, CardServiceExcel>(); container.Register <INumberGenerator, NumberGenerator>(); container.Register <IRetRefNumberGenerator, RetRefNumberGenerator>(); container.Register <IPurchaseService, PurchaseService>(); }
public static IDependencyContainer RegisterUIDependencies(this IDependencyContainer container) { container.Register <IBootstrapViewModel, BootstrapViewModel>(); container.Register <IStoreListViewModel, StoreListViewModel>(); container.Register <IProductListViewModel, ProductListViewModel>(); container.Register <IProductViewModel, ProductViewModel>(); container.Register <ILogInViewModel, LogInViewModel>(); return(container); }
/// <summary> /// Create all dependencies /// </summary> protected virtual void BuildDependencies(IDependencyContainer container) { // Register default type container.RegisterInstance(this); container.RegisterInstance <IStreamProvider>(this); container.RegisterInstance <ITracer>(this); container.RegisterInstance <IDependencyContainer>(container); // Register engines types container.Register <SweDate, SweDate>(); container.Register <SwePlanet, SwePlanet>(); }
static ApplicationContainer() { Container = DependencyContainer.Create(); //In House Types Container.RegisterSingleton <IZoo, Zoo>(() => new Zoo(Container.Resolve <IAnimalService>(), Container.Resolve <IVisitorService>())); Container.Register <IVisitorService, VisitorService>(() => new VisitorService(Container.Resolve <IPersonNameGenerator>())); Container.Register <IAnimalService, AnimalService>(); //External Types Container.Register <IPersonNameGenerator, PersonNameGenerator>(); }
private void RegisterNativeServices(IDependencyContainer container) { container.Register(t => AppleDevice.CurrentDevice); container.Register(t => t.Resolve <IDevice>().Display); container.Register <IGeolocator, Geolocator>(); container.Register <ILocalize, LocalizeService>(); container.Register <IFontManager>(t => new FontManager(t.Resolve <IDisplay>())); container.Register <IMediaPicker, MediaPicker>(); container.Register <IPlatformService, PlatformService>(); container.Register <IFacebookLoginService, FacebookLoginService>(); container.Register <ITwitterLoginService, TwitterLoginService>(); container.Register(t => UserDialogs.Instance); }
private NavigationService SetupNavigationService(IDependencyContainer container) { var baseNavigationPage = new NavigationPage(); var navigation = baseNavigationPage.Navigation; container.Register(navigation); var navigationService = new NavigationService(navigation); container.Register<INavigationService>(navigationService); MainPage = baseNavigationPage; return navigationService; }
public void Configure(IDependencyContainer container) { container.Register<IEventPublisher, EventPublisher>(); container.Register<IEventListener, AsyncTestEventListener>(); AConf aSyncConf = new AConf(); aSyncConf.EndPoint = () => { return "async/execute"; }; aSyncConf.SiteUrl = () => { return ConfigurationManager.AppSettings["SiteURL"]; }; container.RegisterSingleton<IAsyncConfiguration>(aSyncConf); container.Register<IAsyncTask, AsyncWebTask>(); }
/// <summary> /// Create a new planet management /// </summary> public SwePlanet(IDependencyContainer container) { UseNeely = true; _Container = container; // Define default providers if not exists if (!container.CanResolve <IOsculatingElementProvider>()) { container.Register <IOsculatingElementProvider, OsculatingElementFile>(false); } if (!container.CanResolve <IAsteroidNameProvider>()) { container.Register <IAsteroidNameProvider, AsteroidNameFile>(false); } }
public void Configure(IDependencyContainer container) { container.Register <IEventPublisher, EventPublisher>(); container.Register <IEventListener, AsyncTestEventListener>(); AConf aSyncConf = new AConf(); aSyncConf.EndPoint = () => { return("async/execute"); }; aSyncConf.SiteUrl = () => { return(ConfigurationManager.AppSettings["SiteURL"]); }; container.RegisterSingleton <IAsyncConfiguration>(aSyncConf); container.Register <IAsyncTask, AsyncWebTask>(); }
private NavigationService SetupNavigationService(IDependencyContainer container) { var baseNavigationPage = new NavigationPage(); var navigation = baseNavigationPage.Navigation; container.Register(navigation); var navigationService = new NavigationService(navigation); container.Register <INavigationService>(navigationService); MainPage = baseNavigationPage; return(navigationService); }
void IApplicationHost.InitializeContainer(IDependencyContainer container) { container .Register<IHttpConnector, HttpConnector>(() => new HttpConnector()) .Register<IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler()) ; }
void RegisterRepositories(IDependencyContainer dp, Func <ProjectDbContext> dbContextConst) { var studentRepoBuilder = new Func <object[], object>((parameters) => { return(new EfCoreRepository <Student>(dbContextConst())); }); var subjectsRepoBuilder = new Func <object[], object>((parameters) => { return(new SubjectsRepository(dbContextConst())); }); dp.Register <IRepository <Student>, EfCoreRepository <Student> >(studentRepoBuilder); dp.Register <IRepository <Subject>, SubjectsRepository>(subjectsRepoBuilder); dp.Register <ISubjectsRepository, SubjectsRepository>(subjectsRepoBuilder); }
protected override void InitializeContainer(IDependencyContainer container) { // Add default winrt registration base.InitializeContainer(container); // Add aspnet specific registrations container.Register <IUserContext, AspnetUserContext>(() => UserContextViaHttpContext.Instance); }
protected override void InitializeContainer(IDependencyContainer container) { // Add default winrt registration base.InitializeContainer(container); // Add aspnet specific registrations container.Register<IUserContext, AspnetUserContext>(() => UserContextViaHttpContext.Instance); }
public static IDependencyContainer RegisterFormsDependencies(this IDependencyContainer container) { container.RegisterSingleton <IDialogService, DialogService>(); container.RegisterSingleton <INavigationService, NavigationService>(); container.Register <IAuthenticationService, AuthenticationService>(); return(container); }
public virtual void InitializeContainer(IDependencyContainer container) { container .Register <IHttpConnector, HttpConnector>(() => HttpConnector.Instance) .Register <IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler()) .Register <ITraceWriter, DefaultTraceWriter>(() => DefaultTraceWriter.Instance) ; }
public static void ConfigureContainer(IDependencyContainer container) { container .Register <IJsonSerializer, JsonDotNetSerializer>(() => new JsonDotNetSerializer()) .Register <ITraceWriter, NullTraceWriter>(() => NullTraceWriter.Instance) .RegisterInstance <Services.ICreateInstanceBehaviorFactory, Services.CreateInstanceBehaviorFactory>(new Services.CreateInstanceBehaviorFactory()) ; }
public virtual void InitializeContainer(IDependencyContainer container) { container .Register<IHttpConnector, HttpConnector>(() => HttpConnector.Instance) .Register<IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler()) .Register<ITraceWriter, DefaultTraceWriter>(() => DefaultTraceWriter.Instance) ; }
public static void ConfigureContainer(IDependencyContainer container) { container .Register<IJsonSerializer, JsonDotNetSerializer>(() => new JsonDotNetSerializer()) .Register<ITraceWriter, NullTraceWriter>(() => NullTraceWriter.Instance) .RegisterInstance<Services.ICreateInstanceBehaviorFactory, Services.CreateInstanceBehaviorFactory>(new Services.CreateInstanceBehaviorFactory()) ; }
public void InitializeContainer(IDependencyContainer container) { container .Register <IRealTimeTransport, SignalRTransport>(() => new SignalRTransport()) .Register <IHttpConnector, HttpConnector>(() => new HttpConnector()) .Register <IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler()) .Register <IExceptionFactory, ExceptionFactory>(() => new ExceptionFactory()); }
public void InitializeContainer(IDependencyContainer container) { container .Register <IRealTimeTransport, SignalRTransport>( () => new SignalRTransport() ) .Register<IHttpConnector, HttpConnector>(() => new HttpConnector()) .Register<IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler()) .Register<IExceptionFactory, ExceptionFactory>(() => new ExceptionFactory()); }
public void RegisterRepositories(IDependencyContainer depCon) { var empleatRepoBuilder = new Func <object[], object>((parameters) => { return(new GenericRepository <Empleat>(GetDbConstructor())); }); depCon.Register <IRepository <Empleat>, GenericRepository <Empleat> >(empleatRepoBuilder); }
public void IsRegistered_PositiveTest() { //Arrange Container.Register(_ => Guid.NewGuid()); //Act var result = Container.IsRegistered <Guid>(); //Assert Assert.IsTrue(result); }
/// <summary> /// Create a new SweDate /// </summary> public SweDate(IDependencyContainer container) { _Container = container; // Define default provider if not exists if (!container.CanResolve <Date.IDeltaTRecordProvider>()) { container.Register <Date.IDeltaTRecordProvider, Date.DeltaTRecordFile>(false); } TidalAcceleration = TidalDefault; }
private static void RegisterDefaults(IDependencyContainer dependencyContainer) { dependencyContainer .Register <ISubscriptionManager, SingletonSubscriptionManager>(() => SingletonSubscriptionManager.Instance) .Register <IRealTimeChannelFactory, RealTimeChannelFactory>(() => new RealTimeChannelFactory()) .Register <IRealTimeChannel, RealTimeChannel>(() => new RealTimeChannel()) .Register <IUserContext, StaticUserContext>(() => new StaticUserContext()) .Register <IJsonSerializer, JsonDotNetSerializer>(() => new JsonDotNetSerializer()) .Register <IExceptionFactory, ServiceExceptionFactory>(() => ServiceExceptionFactory.Instance) ; }
/// <summary> /// Initializes the navigation framework. /// </summary> /// <param name="navigation">The Xamarin forms navigation service.</param> /// <param name="container">The dependency container to use for handling registration.</param> /// <exception cref="ArgumentNullException"><paramref name="navigation" /> is <see langword="null" />.</exception> /// <exception cref="NullReferenceException">navigation must be valid</exception> public static void Init(INavigation navigation, IDependencyContainer container = null) { if (container == null) { container = Resolver.Resolve <IDependencyContainer>(); } if (container == null) { throw new ArgumentNullException(nameof(container), "IOC Dependency Container must be set"); } if (navigation == null) { throw new ArgumentNullException(nameof(navigation), "Navigation cannot be null"); } var nav = new NavigationServiceV2(navigation); container.Register <INavigation>(t => nav); container.Register <INavigationServiceV2>(t => nav); }
public void Install(IDependencyContainer container) { // Create an input manager and bind its implemented interfaces KeyboardInputManager keyboard = new KeyboardInputManager(); container.RegisterWithInterfaces <KeyboardInputManager>(new InstanceBinding <KeyboardInputManager>(keyboard)); if (settings != null) { container.Register(new InstanceBinding <CharacterSettings>(settings)); } }
private static void RegisterDefaults(IDependencyContainer dependencyContainer) { dependencyContainer .Register<IUserContext, StaticUserContext>(() => new StaticUserContext()) .Register<IJsonSerializer, JsonDotNetSerializer>(() => new JsonDotNetSerializer()) .Register<IFileService, FileService>(() => FileService.Instance) .Register<IConnectionService, ConnectionService>(() => ConnectionService.Instance) .Register<ISessionService, SessionService>(() => SessionService.Instance) .Register<IArticleService, ArticleService>(() => ArticleService.Instance) .Register<IUserService, UserService>(() => UserService.Instance) ; }
public void RegisterRepositories(IDependencyContainer depCon, Func <AcademyDbContext> dbContextConst) { var studentRepoBuilder = new Func <object[], object>((parameters) => { return(new EfCoreRepository <Student>(dbContextConst())); }); var subjectsRepoBuilder = new Func <object[], object>((parameters) => { return(new EfCoreRepository <Subject>(dbContextConst())); }); depCon.Register <IRepository <Student>, EfCoreRepository <Student> >(studentRepoBuilder); depCon.Register <IRepository <Subject>, EfCoreRepository <Subject> >(subjectsRepoBuilder); //depCon.Register<IRepository<StudentSubject>, EfCoreRepository<StudentSubject>>(studentsubjectsRepoBuilder); //depCon.Register<IRepository<Exam>, EfCoreRepository<Exam>>(examsRepoBuilder); //depCon.Register<IRepository<StudentExam>, EfCoreRepository<StudentExam>>(studentsExamRepoBuilder); }
void RegisterRepositories(IDependencyContainer dp) { dp.Register <IRepository <Student>, StudentClientRepository>(); dp.Register <IStudentRepository, StudentClientRepository>(); dp.Register <IRepository <Subject>, SubjectClientRepository>(); dp.Register <ISubjectRepository, SubjectClientRepository>(); dp.Register <IRepository <Teacher>, TeacherClientRepository>(); dp.Register <ITeacherRepository, TeacherClientRepository>(); }
public void InitializeContainer(IDependencyContainer container) { container .Register<IHttpConnector, HttpConnector>(() => new HttpConnector()) .Register<IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler()) .RegisterInstance<ILocalStorage, IsolatedLocalStorage>("wp8", IsolatedLocalStorage.Instance) .RegisterInstance<ITraceWriter, DebugTraceWriter>(new DebugTraceWriter()); ; var deviceState = new WPDeviceState( container.Build<ILocalStorage>("wp8"), container.Build<IJsonSerializer>()); container.RegisterInstance<IDeviceState, WPDeviceState>("wp8", deviceState); var appState = new WPApplicationState( container.Build<ILocalStorage>("wp8"), container.Build<IJsonSerializer>()); container.RegisterInstance<IApplicationState, WPApplicationState>("wp8", appState); }
private void RegisterServices() { // Register the Services and creating the container m_container.Register <IBoardComponentFactory>(new BoardComponentFactory()); m_container.Register <ILevelProvider>(new LevelProviderProxy()); m_container.Register <IMovementCommandService>(new MovementCommandService()); m_container.Register <IWorkerStateMachine>(new WorkerStateMachine()); m_container.Register <IOutputInputFactory>(new ConsoleOutputInputFactory( new BigLettersImplementor(), new KeyboardImplementor() )); m_container.Register <ISokobanGameTemplate>(new SokobanGameTemplate()); // Creatingthe Sokoban.Main Game Template }
void RegisterRepositories(IDependencyContainer dp, Func <ProjectDbContext> dbContextConst) { var studentRepoBuilder = new Func <object[], object>((parameters) => { return(new GenericRepository <Student>(dbContextConst())); }); var subjectsRepoBuilder2 = new Func <object[], object>((parameters) => //Original { return(new SubjectsRepository(dbContextConst())); }); var subjectsRepoBuilder = new Func <object[], object>((parameters) => //meu { return(new GenericRepository <Subject>(dbContextConst())); }); var examsRepoBuilder = new Func <object[], object>((parameters) => //meu { return(new GenericRepository <Exam>(dbContextConst())); }); var studentExamsRepoBuilder = new Func <object[], object>((parameters) => //meu { return(new GenericRepository <StudentExam>(dbContextConst())); //Meu }); var studentSubjectRepoBuilder = new Func <object[], object>((parameters) => //meu { return(new GenericRepository <StudentSubject>(dbContextConst())); //Meu }); var studentRepoBuilder2 = new Func <object[], object>((parameters) => //meu { return(new StudentsRepository(dbContextConst())); }); dp.Register <IRepository <Student>, GenericRepository <Student> >(studentRepoBuilder); dp.Register <IRepository <Subject>, GenericRepository <Subject> >(subjectsRepoBuilder); //meu dp.Register <IRepository <Exam>, GenericRepository <Exam> >(examsRepoBuilder); //meu dp.Register <IRepository <StudentExam>, GenericRepository <StudentExam> >(studentExamsRepoBuilder); //meu dp.Register <IRepository <StudentSubject>, GenericRepository <StudentSubject> >(studentSubjectRepoBuilder); //meu dp.Register <IRepository <Subject>, SubjectsRepository>(subjectsRepoBuilder); dp.Register <ISubjectsRepository, SubjectsRepository>(subjectsRepoBuilder2); dp.Register <IStudentsRepository, StudentsRepository>(studentRepoBuilder2); //Meu }
public void InitializeContainer(IDependencyContainer container) { container .Register <IHttpConnector, HttpConnector>(() => new HttpConnector()) .Register <IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler()) .RegisterInstance <ILocalStorage, IsolatedLocalStorage>("wp7", IsolatedLocalStorage.Instance) .RegisterInstance <ITraceWriter, DebugTraceWriter>(new DebugTraceWriter()); ; var deviceState = new WPDeviceState( container.Build <ILocalStorage>("wp7"), container.Build <IJsonSerializer>()); container.RegisterInstance <IDeviceState, WPDeviceState>("wp7", deviceState); var appState = new WPApplicationState( container.Build <ILocalStorage>("wp7"), container.Build <IJsonSerializer>()); container.RegisterInstance <IApplicationState, WPApplicationState>("wp7", appState); }
private void RegisterViewModelViewDependencies(IDependencyContainer resolverContainer) { var presenterManager = new PresenterManager(); presenterManager.AddViewDependency <DataSyncViewModel, DataSyncPage>(); presenterManager.AddViewDependency <MainViewModel, MainPage>(); presenterManager.AddViewDependency <MenuViewModel, MenuPage>(); presenterManager.AddViewDependency <TrainingJournalViewModel, TrainingJournalPage>(); presenterManager.AddViewDependency <EditTrainingWeekViewModel, EditTrainingWeekPage>(); presenterManager.AddViewDependency <TrainingWeekViewModel, TrainingWeekPage>(); presenterManager.AddViewDependency <LoginViewModel, LoginPage>(); presenterManager.AddViewDependency <RegisterAccountViewModel, RegisterAccountPage>(); presenterManager.AddViewDependency <EditUserProfileViewModel, EditUserProfilePage>(); presenterManager.AddViewDependency <ListViewModel, ListPage>(); presenterManager.AddViewDependency <CopyTrainingWeekViewModel, CopyTrainingWeekPage>(); presenterManager.AddViewDependency <CreateTrainingDayViewModel, CreateTrainingDayPage>(); presenterManager.AddViewDependency <TrainingDayViewModel, TrainingDayPage>(); presenterManager.AddViewDependency <SelectTrainingExercisesViewModel, SelectTrainingExercisesPage> (); presenterManager.AddViewDependency <EditTrainingExerciseViewModel, EditTrainingExercisePage>(); presenterManager.AddViewDependency <WebViewViewModel, WebViewPage> (); presenterManager.AddViewDependency <ConfidentialityRulesViewModel, ConfidentialityRulesPage>(); resolverContainer.Register <IPresenterManager> (presenterManager); }
public void Register(IDependencyContainer container) { //Place all the registrations here. container.Register <IConnectionsDialog, ConnectionsDialog>(); }
private static void RegisterDefaults(IDependencyContainer dependencyContainer) { dependencyContainer .Register<ISubscriptionManager, SingletonSubscriptionManager>( () => SingletonSubscriptionManager.Instance ) .Register<IRealTimeChannelFactory, RealTimeChannelFactory>( () => new RealTimeChannelFactory() ) .Register<IRealTimeChannel, RealTimeChannel>( () => new RealTimeChannel() ) .Register<IUserContext, StaticUserContext>(() => new StaticUserContext()) .Register<IJsonSerializer, JsonDotNetSerializer>(() => new JsonDotNetSerializer()) .Register<IExceptionFactory, ServiceExceptionFactory>( () => ServiceExceptionFactory.Instance ) .Register<ITraceWriter, NullTraceWriter>(() => NullTraceWriter.Instance) ; }
public void Configure(IDependencyContainer container) { container.RegisterPerRequest<INavigation, TopNavigation>(); container.Register<ILogger, ASPNETTraceLog>(); }