Exemple #1
0
 private void RegisterBuildConfig()
 {
     #if DEBUG
     _iocService.RegisterInstance <IBuildConfig>(BuildConfig.Debug);
     #else
     _iocService.RegisterInstance <IBuildConfig>(BuildConfig.Release);
     #endif
 }
Exemple #2
0
 public static IIocService AddDeviceServices(this IIocService iocService)
 {
     iocService.RegisterInstance <IRuntimePlatform>(RuntimePlatform.UWP);
     iocService.RegisterImplementation <IDeviceInfoService, UwpDeviceInfoService>(IocLifetime.Singleton);
     iocService.RegisterImplementation <IApplicationInfoService, ApplicationInfoService>();
     iocService.RegisterImplementation <ISecureStorageService, SecureStorageService>();
     return(iocService);
 }
Exemple #3
0
        private static void Register(IIocService iocService)
        {
            var httpClientFactory = (IHttpClientFactory) new ServiceCollection()
                                    .AddHttpClient()
                                    .BuildServiceProvider()
                                    .GetService(typeof(IHttpClientFactory));

            iocService.RegisterInstance(httpClientFactory);
            iocService.RegisterImplementation <IHttpClientService, Service.HttpClientService>(IocLifetime.Singleton);
            iocService.RegisterImplementation <IHttpClientServiceConfig, DefaultHttpClientServiceConfig>(IocLifetime.Singleton);
            iocService.RegisterConsoleLoggerClientService();
        }
Exemple #4
0
 public static IIocService AddDeviceServices(this IIocService iocService)
 {
     iocService.RegisterInstance <IRuntimePlatform>(RuntimePlatform.Android);
     iocService.RegisterImplementation <IDeviceInfoService, AndroidDeviceInfoService>(IocLifetime.Singleton);
     return(iocService);
 }