コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Bootstrapper.cs プロジェクト: DavidManya/WPF-MVVM
        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);
        }
コード例 #3
0
        public static void ContainerConfig(IDependencyContainer container)
        {
            var config = new Config();

            container.Register <IObjectConstructionTask, UnityConstruction>();
            //  config.EnableCaching = false;

            container.Register(new SitecoreInstaller(config));
        }
コード例 #4
0
        public void Register(IDependencyContainer container)
        {
            container.Register <ICardServiceExcel, CardServiceExcel>();

            container.Register <INumberGenerator, NumberGenerator>();
            container.Register <IRetRefNumberGenerator, RetRefNumberGenerator>();

            container.Register <IPurchaseService, PurchaseService>();
        }
コード例 #5
0
 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);
 }
コード例 #6
0
 /// <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>();
 }
コード例 #7
0
        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>();
        }
コード例 #8
0
ファイル: AppDelegate.cs プロジェクト: koland/bshkara
 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);
 }
コード例 #9
0
        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;
        }
コード例 #10
0
		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>();
		}
コード例 #11
0
ファイル: SwePlanet.cs プロジェクト: ygrenier/SwephNet
 /// <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);
     }
 }
コード例 #12
0
        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>();
        }
コード例 #13
0
        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);
        }
コード例 #14
0
 void IApplicationHost.InitializeContainer(IDependencyContainer container)
 {
     container
         .Register<IHttpConnector, HttpConnector>(() => new HttpConnector())
         .Register<IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler())
         ;
 }
コード例 #15
0
        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);
        }
コード例 #16
0
 protected override void InitializeContainer(IDependencyContainer container)
 {
     // Add default winrt registration
     base.InitializeContainer(container);
     // Add aspnet specific registrations
     container.Register <IUserContext, AspnetUserContext>(() => UserContextViaHttpContext.Instance);
 }
コード例 #17
0
 protected override void InitializeContainer(IDependencyContainer container)
 {
     // Add default winrt registration
     base.InitializeContainer(container);
     // Add aspnet specific registrations
     container.Register<IUserContext, AspnetUserContext>(() => UserContextViaHttpContext.Instance);
 }
コード例 #18
0
ファイル: Startup.cs プロジェクト: Xamlab/RealmDbSample
        public static IDependencyContainer RegisterFormsDependencies(this IDependencyContainer container)
        {
            container.RegisterSingleton <IDialogService, DialogService>();
            container.RegisterSingleton <INavigationService, NavigationService>();
            container.Register <IAuthenticationService, AuthenticationService>();

            return(container);
        }
コード例 #19
0
 public virtual void InitializeContainer(IDependencyContainer container)
 {
     container
     .Register <IHttpConnector, HttpConnector>(() => HttpConnector.Instance)
     .Register <IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler())
     .Register <ITraceWriter, DefaultTraceWriter>(() => DefaultTraceWriter.Instance)
     ;
 }
コード例 #20
0
 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())
     ;
 }
コード例 #21
0
 public virtual void InitializeContainer(IDependencyContainer container)
 {
     container
         .Register<IHttpConnector, HttpConnector>(() => HttpConnector.Instance)
         .Register<IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler())
         .Register<ITraceWriter, DefaultTraceWriter>(() => DefaultTraceWriter.Instance)
         ;
 }
コード例 #22
0
 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())
             ;
 }
コード例 #23
0
 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());
 }
コード例 #24
0
 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());
 }
コード例 #25
0
        public void RegisterRepositories(IDependencyContainer depCon)
        {
            var empleatRepoBuilder = new Func <object[], object>((parameters) =>
            {
                return(new GenericRepository <Empleat>(GetDbConstructor()));
            });

            depCon.Register <IRepository <Empleat>, GenericRepository <Empleat> >(empleatRepoBuilder);
        }
コード例 #26
0
        public void IsRegistered_PositiveTest()
        {
            //Arrange
            Container.Register(_ => Guid.NewGuid());

            //Act
            var result = Container.IsRegistered <Guid>();

            //Assert
            Assert.IsTrue(result);
        }
コード例 #27
0
ファイル: SweDate.cs プロジェクト: ygrenier/SwephNet
 /// <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;
 }
コード例 #28
0
 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)
     ;
 }
コード例 #29
0
        /// <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));
            }
        }
コード例 #31
0
 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)
                     ;
 }
コード例 #32
0
        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);
        }
コード例 #33
0
        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>();
        }
コード例 #34
0
 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);
 }
コード例 #35
0
 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
 }
コード例 #36
0
        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
        }
コード例 #37
0
        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);
        }
コード例 #38
0
        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);
        }
コード例 #39
0
 public void Register(IDependencyContainer container)
 {
     //Place all the registrations here.
     container.Register <IConnectionsDialog, ConnectionsDialog>();
 }
コード例 #40
0
 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)
             ;
 }
コード例 #41
0
		public void Configure(IDependencyContainer container) {
			container.RegisterPerRequest<INavigation, TopNavigation>();
			container.Register<ILogger, ASPNETTraceLog>();
		}