public override void Load(IRegistrator registrar)
        {
            var navigationView = new NavigationView();

            registrar.RegisterInstance <IView>(navigationView, IfAlreadyRegistered.Replace, Setup.Default, nameof(NavigationView));
            registrar.RegisterInstance <IParameterViewStackService>(new ParameterViewStackService(navigationView));
            registrar.RegisterInstance <IViewModelFactory>(new DefaultViewModelFactory());
        }
Beispiel #2
0
        /// <inheritdoc />
        public override void Load(IRegistrator registrar)
        {
            var funcLogManager = new FuncLogManager(type =>
            {
                var actualLogger = Log.ForContext(type);
                return(new SerilogFullLogger(actualLogger));
            });

            registrar.RegisterInstance(Log.Logger);
            registrar.Register <IFullLogger, SerilogFullLogger>(Reuse.Singleton);
            registrar.RegisterInstance(funcLogManager);
        }
Beispiel #3
0
 public QueueConfigurator SetConfigurationProvider <TConfiguration>(TConfiguration configuration = default(TConfiguration))
     where TConfiguration : class, IMessagingConfiguration
 {
     if (configuration == null)
     {
         _registrator.Register <IMessagingConfiguration, TConfiguration>();
     }
     else
     {
         _registrator.RegisterInstance <IMessagingConfiguration>(configuration);
     }
     return(this);
 }
Beispiel #4
0
        private static void BuildMediator(IRegistrator container, TextWriter writer)
        {
            container.RegisterInstance(writer);
            container.RegisterMany(new[] { typeof(Program).GetAssembly() }, Registrator.Interfaces);

            container.Register(typeof(IMessageHandler <,>), typeof(MiddlewareMessageHandler <,>), setup: Setup.Decorator);
            container.Register(typeof(BroadcastMessageHandler <>));
        }
Beispiel #5
0
 public CompositionRoot(IRegistrator registrator)
 {
     registrator.Register <IUserService, UserService>();
     registrator.Register <IGameService, GameService>();
     registrator.Register <IEmailService, EmailService>();
     registrator.Register <ISmtpHelper, SmtpHelper>();
     registrator.Register <IGameRepository, GameRepository>();
     registrator.Register <IAuthorizationHandler, IsUserInvolvedAuthorizationHandler>();
     registrator.RegisterInstance(new TicTacToeHelper());
 }
Beispiel #6
0
        public void RegisterDefault(IRegistrator registrator)
        {
            registrator.Register <ITopicNameProvider, DefaultTopicNameProvider>();
            registrator.Register <IQueueSubscriber, DefaultQueueSubscriber>();
            registrator.Register <IQueuePublisher, QueuePublisher>();
            registrator.Register <IMessageHandlerFactory, MessageHandlerFactory>();
            registrator.Register <IMessagingConfiguration, DefaultMessagingConfiguration>();
            registrator.Register <IMessagingLogger, ConsoleMessagingLogger>();

            registrator.Register <QueueListener>();
            registrator.Register <MessageProcessor>();
            registrator.Register <UnprocessedMessagesResender>();

            registrator.RegisterSingleton <IMessageTypesCache, MessageTypesCache>();
            registrator.RegisterSingleton <IMessageHandlersCache, MessageHandlersCache>();

            registrator.RegisterInstance <IMessagingConfiguration>(DefaultMessagingConfiguration.Create());
        }