public IReadOnlyCollection <IKeyboardEventReceiver> CreateApplicableKeyboardReceivers(KeyboardInput keyboardInput) { var inputType = typeof(IEventReceiver <KeyboardInput>); return(_registrationServices.SelectMany(regService => regService.Registrations) .Where(reg => inputType.IsAssignableFrom(reg.ReceiverType)) .Where(reg => ((KeyboardEventConfiguration)reg.ConfigCallback()).CheckIfApplicable(keyboardInput)) .Select(reg => _provisioningService.GetService(reg.ReceiverType)) .Cast <IKeyboardEventReceiver>() .ToList()); }
public void NavigateToDetails(Maybe <SolutionModeConfigurationDto> configurationMaybe) { var viewModel = _provisioningService.GetService <ConfigurationDetailsViewModel>(); viewModel.Initialize(configurationMaybe); _navigationHandler.NavigateTo(viewModel); }
public void NavigateToProjectSelection(SolutionModeConfigurationDto configuration) { var viewModel = _provisioningService.GetService <ProjectSelectionViewModel>(); var projectsInSolution = _projectSelectionService.LoadProjects(configuration.SolutionFilePath); var selectProjects = _selectProjectDtoMappingHandler.Map(projectsInSolution, configuration); viewModel.Initialize(configuration, selectProjects); _navigationHandler.NavigateTo(viewModel); }
public ViewModelBase CreateViewModel(Type viewModelType) { var viewModelBaseType = typeof(ViewModelBase); if (!viewModelBaseType.IsAssignableFrom(viewModelType)) { throw new ArgumentException($"{viewModelType.Name} is not assignable from ViewModelBase."); } var viewModel = (ViewModelBase)_provisioningService.GetService(viewModelType); return(viewModel); }
public IRepository <T> CreateRepository <T>() where T : AggregateRoot { var result = _provisioningService.GetService <IRepository <T> >(); return(result); }