public void Execute(BootstrapperConfig config)
        {
            var simpleIoc = config.GetSimpleIoc();

            SetupDependencies(simpleIoc);
            SetupTheme();
        }
Пример #2
0
        public void Execute(BootstrapperConfig config)
        {
            var simpleIoc = config.GetSimpleIoc();

            SetupDependencies(simpleIoc);
            SetupViewModelLocator(simpleIoc);
        }
Пример #3
0
        private static BootstrapperConfig CreateBootstrapperConfig(UIKit.UIApplication application, Foundation.NSDictionary launchOptions)
        {
            var config = new BootstrapperConfig();

            config.SetSimpleIoc(new SimpleIoc());

            return(config);
        }
Пример #4
0
        public void Execute(BootstrapperConfig config)
        {
            var simpleIoc = config.GetSimpleIoc();

            SetupDependencies(simpleIoc);
            SetupInteractors(simpleIoc);
            SetupViewModels(simpleIoc);
            SetupViewModelProvider(simpleIoc);
        }
Пример #5
0
        private static void ExecuteBootstrappers(BootstrapperConfig config)
        {
            var compositeBootstrapper = new CompositeBootstrapper(
                new PlatformBootstrapper(),
                new ApplicationBootstrapper(),
                new PresentationBootstrapper());

            compositeBootstrapper.Execute(config);
        }
        public void Execute(BootstrapperConfig config)
        {
            var simpleIoc = config.GetSimpleIoc();

            SetupDependencies(simpleIoc);
            SetupViewModels(simpleIoc);
            SetupLifecycleViewModelProvider(simpleIoc);
            SetupImageService(simpleIoc);
        }
Пример #7
0
        public override void OnCreate()
        {
            var config = new BootstrapperConfig();

            config.SetSimpleIoc(new SimpleIoc());

            var compositeBootstrapper = new CompositeBootstrapper(new AndroidBootstrapper(), new CoreBootstrapper());

            compositeBootstrapper.Execute(config);
        }
Пример #8
0
        private void InitFramework()
        {
            var config = new BootstrapperConfig();

            config.SetSimpleIoc(new SimpleIoc());

            var compositeBootstrapper = new CompositeBootstrapper(new IosBootstrapper(), new CoreBootstrapper());

            compositeBootstrapper.Execute(config);
        }
Пример #9
0
        public void Execute(BootstrapperConfig config)
        {
            var simpleIoc = config.GetSimpleIoc();

            simpleIoc.Register <IWebConnectionService>(() => new WebConnectionService(), FlexiMvvm.Ioc.Reuse.Singleton);

            simpleIoc.Register <IApiSettingsService>(() => new ApiSettingsService(simpleIoc.Get <IWebConnectionService>()), FlexiMvvm.Ioc.Reuse.Singleton);

            simpleIoc.Register <IAuthenticationApiService>(() => new AuthenticationApiService(simpleIoc.Get <IWebConnectionService>(), simpleIoc.Get <IApiSettingsService>()), FlexiMvvm.Ioc.Reuse.Singleton);

            simpleIoc.Register <IVacationRequestsApiService>(() => new VacationRequestsApiService(simpleIoc.Get <IWebConnectionService>(), simpleIoc.Get <IApiSettingsService>()), FlexiMvvm.Ioc.Reuse.Singleton);
        }
        /// <inheritdoc />
        public void Execute(BootstrapperConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            foreach (var bootstrapper in _bootstrappers)
            {
                bootstrapper.Execute(config);
            }
        }
Пример #11
0
        public void Execute(BootstrapperConfig config)
        {
            var simpleIoc = config.GetSimpleIoc();

            simpleIoc.Register(() => new EntryViewModel(simpleIoc.Get <INavigationService>()));
            simpleIoc.Register(() => new HomeViewModel(simpleIoc.Get <INavigationService>()));
            simpleIoc.Register(() => new FirstViewModel(simpleIoc.Get <INavigationService>()));
            simpleIoc.Register(() => new SecondViewModel(simpleIoc.Get <INavigationService>()));
            simpleIoc.Register(() => new ThirdViewModel(simpleIoc.Get <INavigationService>()));
            simpleIoc.Register(() => new CustomFlowNavigationViewModel());

            LifecycleViewModelProvider.SetFactory(new DefaultLifecycleViewModelFactory(simpleIoc));
        }
Пример #12
0
        public void Execute(BootstrapperConfig config)
        {
            var simpleIoc = config.GetSimpleIoc();

            var viewResolver = new IosReflectionViewResolver(new[] { GetType().Assembly });

            simpleIoc.Register <IViewResolver>(() => viewResolver, Reuse.Singleton);

            var windowHolder = new WindowHolderWrapper(() => AppDelegate.Window, w => AppDelegate.Window = w);

            var viewPresenter = new FlexiMvvmIosViewPresenter(windowHolder, new ActivatorViewFactory(), new LifecycleViewModelToViewControllerCache());

            simpleIoc.Register <IFlexiMvvmViewPresenter>(() => viewPresenter, Reuse.Singleton);
        }
        private static BootstrapperConfig CreateBootstrapperConfig()
        {
            var config = new BootstrapperConfig();

            config.SetSimpleIoc(new SimpleIoc());
#if DEBUG
            config.SetAppExecutionEnvironment(AppExecutionEnvironment.Dev);
#elif QA_ENV
            config.SetAppExecutionEnvironment(AppExecutionEnvironment.Qa);
#else
            config.SetAppExecutionEnvironment(AppExecutionEnvironment.Prod);
#endif

            return(config);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            CrossCurrentActivity.Current.Init(this, savedInstanceState);

            var config = new BootstrapperConfig();

            config.SetSimpleIoc(new SimpleIoc());

            var compositeBootstrapper = new CompositeBootstrapper(
                new CoreBootstrapper(),
                new AndroidBootstrapper());

            compositeBootstrapper.Execute(config);

            base.OnCreate(savedInstanceState);
        }
Пример #15
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            var config = new BootstrapperConfig();

            config.SetSimpleIoc(new SimpleIoc());
            var compositeBootstrapper = new CompositeBootstrapper(
                new CoreBootstrapper(),
                new IosBootstrapper());

            compositeBootstrapper.Execute(config);

            Window = new UIWindow(UIScreen.MainScreen.Bounds)
            {
                RootViewController = new RootNavigationController()
            };
            Window.MakeKeyAndVisible();

            return(true);
        }
Пример #16
0
        public void Execute(BootstrapperConfig config)
        {
            InitApi(config);

            var simpleIoc = config.GetSimpleIoc();

            simpleIoc.Register <IOperationFactory>(() => new OperationFactory(simpleIoc, new OperationErrorHandler()), FlexiMvvm.Ioc.Reuse.Singleton);

            simpleIoc.Register <IUserDialogs>(() => UserDialogs.Instance, FlexiMvvm.Ioc.Reuse.Singleton);

            simpleIoc.Register <IRealmProvider>(() => new RealmProvider(), FlexiMvvm.Ioc.Reuse.Singleton);

            simpleIoc.Register <IVacationRequestsRepository>(() => new VacationRequestsRepository(new ExpressMapperRealmRepositoryEntriesMapper <VacantionRequest, VacationRequestRealmObject>(), simpleIoc.Get <IRealmProvider>()));

            simpleIoc.Register <IVacationRequestsManagerService>(() => new VacationRequestsManagerService(simpleIoc.Get <IVacationRequestsRepository>(), simpleIoc.Get <IVacationRequestsApiService>()), FlexiMvvm.Ioc.Reuse.Singleton);

            simpleIoc.Register <IVacationRequestsFilterService>(() => new VacationRequestsFilterService());

            simpleIoc.Register <INavigationService>(
                () => new NavigationService(simpleIoc.Get <IFlexiMvvmViewPresenter>(), simpleIoc.Get <IViewResolver>()),
                Reuse.Singleton);

            IocHelper.RegisterViewModelsFromAssemblyByReflection(simpleIoc, GetType().Assembly);

            LifecycleViewModelProvider.SetFactory(new DefaultLifecycleViewModelFactory(simpleIoc));

            simpleIoc.Register <ISessionService>(() => new SessionService(simpleIoc.Get <IApiSettingsService>(), simpleIoc.Get <IAuthenticationApiService>()), FlexiMvvm.Ioc.Reuse.Singleton);

            var session = simpleIoc.Get <ISessionService>();

            simpleIoc.Get <IApiSettingsService>().RefreshTokenUpdater = session;

            session.OnCredentialsFails += async(sender, e) =>
            {
                await simpleIoc.Get <INavigationService>().Navigate <LoginViewModel>();

                await simpleIoc.Get <IRealmProvider>().Drop().ConfigureAwait(false);
            };

            RegisterMappings();
        }
Пример #17
0
        public void Execute(BootstrapperConfig config)
        {
            var simpleIoc = config.GetSimpleIoc();

            var lifecycleMonitor = new ActivityLifecycleMonitor(_application);

            UserDialogs.Init(() => lifecycleMonitor.CurrentActivity);

            var viewResolver = new AndroidReflectionViewResolver(new[] { GetType().Assembly });

            simpleIoc.Register <IViewResolver>(() => viewResolver, Reuse.Singleton);

            var activityCoordinator = new ActivityCoordinator(lifecycleMonitor);

            var viewPresenter = new FlexiMvvmAndroidViewPresenter(
                activityCoordinator,
                null,
                null,
                null);

            simpleIoc.Register <IFlexiMvvmViewPresenter>(() => viewPresenter, Reuse.Singleton);

            UserDialogs.Init(_application);
        }
Пример #18
0
        public void Execute(BootstrapperConfig config)
        {
            var simpleIoc = config.GetSimpleIoc();

            simpleIoc.Register <INavigationService>(() => new AppNavigationService());
        }
Пример #19
0
 public static ISimpleIoc GetSimpleIoc(this BootstrapperConfig config)
 {
     return(config.GetValue <ISimpleIoc>(SimpleIocKey));
 }
Пример #20
0
 public static void SetSimpleIoc(this BootstrapperConfig config, ISimpleIoc simpleIoc)
 {
     config.SetValue(SimpleIocKey, simpleIoc);
 }
 public static ISimpleIoc GetSimpleIoc(this BootstrapperConfig config)
 {
     return((ISimpleIoc)config.Get(SimpleIocKey));
 }
 public static void SetAppExecutionEnvironment(this BootstrapperConfig config, AppExecutionEnvironment appExecutionEnvironment)
 {
     config.SetValue(AppExecutionEnvironmentKey, appExecutionEnvironment);
 }
 public void Execute(BootstrapperConfig config)
 {
 }
Пример #24
0
        private void InitApi(BootstrapperConfig config)
        {
            var apiBootstrapper = new ApiBootstrapper();

            apiBootstrapper.Execute(config);
        }
 public static AppExecutionEnvironment GetAppExecutionEnvironment(this BootstrapperConfig config)
 {
     return(config.GetValue <AppExecutionEnvironment>(AppExecutionEnvironmentKey));
 }