コード例 #1
0
        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());
        }
コード例 #2
0
        public void NavigateToDetails(Maybe <SolutionModeConfigurationDto> configurationMaybe)
        {
            var viewModel = _provisioningService.GetService <ConfigurationDetailsViewModel>();

            viewModel.Initialize(configurationMaybe);
            _navigationHandler.NavigateTo(viewModel);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public IRepository <T> CreateRepository <T>() where T : AggregateRoot
        {
            var result = _provisioningService.GetService <IRepository <T> >();

            return(result);
        }