コード例 #1
0
        public static BlasticApplication AddProgramDatabase(
            this BlasticApplication application,
            DatabaseProvider databaseProvider,
            string connectionString)
        {
            return(application.Configure(builder =>
            {
                DatabaseConfiguration databaseConfiguration = new DatabaseConfiguration(databaseProvider, connectionString);

                builder.RegisterInstance(databaseConfiguration);

                builder
                .RegisterType <ConnectionFactory>()
                .SingleInstance();

                builder
                .RegisterType <ProgramDatabase>()
                .SingleInstance();

                builder
                .RegisterType <MigrateProgramDatabaseStep>()
                .SingleInstance()
                .As <IInitializationStep>();
            }));
        }
コード例 #2
0
        private static BlasticApplication AddDefaultServices(this BlasticApplication application)
        {
            return(application.Configure(builder =>
            {
                builder
                .RegisterType <ExecutionContextFactory>()
                .SingleInstance();

                builder
                .RegisterType <DialogService>()
                .As <IDialogService>()
                .SingleInstance();

                builder
                .RegisterType <WindowManager>()
                .As <IWindowManager>()
                .SingleInstance();

                builder
                .RegisterType <EventAggregator>()
                .As <IEventAggregator>()
                .SingleInstance();

                builder
                .RegisterType <SnackbarMessageQueue>()
                .As <ISnackbarMessageQueue>()
                .SingleInstance();
            }));
        }
コード例 #3
0
 public static BlasticApplication AddSettingsService(this BlasticApplication application)
 {
     return(application.Configure(builder =>
     {
         builder.RegisterType <SettingsService>()
         .SingleInstance()
         .As <ISettingsService>();
     }));
 }
コード例 #4
0
 public static BlasticApplication RegisterMainTab <T>(this BlasticApplication application) where T : IMainTab
 {
     return(application.Configure(builder =>
     {
         builder.RegisterType <T>()
         .SingleInstance()
         .As <IMainTab>();
     }));
 }
コード例 #5
0
 private static BlasticApplication AddLogging(this BlasticApplication application, LogLevel minimumLogLevel = LogLevel.Trace)
 {
     return(application.Configure(x =>
     {
         x.AddLogging(builder =>
         {
             builder.SetMinimumLevel(minimumLogLevel);
             builder.AddSerilog();
         });
     }));
 }
コード例 #6
0
        public static BlasticApplication AddSettingsWindow(this BlasticApplication application)
        {
            return(application.Configure(builder =>
            {
                builder
                .RegisterType <SettingsViewModel>()
                .SingleInstance();

                builder.RegisterType <ReadSettingsStep>()
                .SingleInstance()
                .As <IInitializationStep>();
            }));
        }
コード例 #7
0
        public static BlasticApplication AddLogsWindow(this BlasticApplication application)
        {
            return(application.Configure(builder =>
            {
                builder
                .RegisterType <LogsViewModel>()
                .SingleInstance();

                builder
                .RegisterType <LogSink>()
                .SingleInstance();

                builder
                .RegisterType <LogSettingsViewModel>()
                .SingleInstance()
                .AsImplementedInterfaces()
                .AsSelf();
            }));
        }