public ComponentInstanceViewModelFactory(
     TestComponentInstanceFactory componentInstanceFactory, OutputFactory outputFactory,
     OperationViewModelFactory operationViewModelFactory, BackgroundTasks backgroundTasks,
     OperationMachinesByControlObject operationMachinesByControlObject,
     ApplicationEvents applicationEvents)
 {
     _componentInstanceFactory         = componentInstanceFactory;
     _outputFactory                    = outputFactory;
     _operationViewModelFactory        = operationViewModelFactory;
     _backgroundTasks                  = backgroundTasks;
     _operationMachinesByControlObject = operationMachinesByControlObject;
     _applicationEvents                = applicationEvents;
 }
        private static void Configure(
            ComponentLocation componentLocation,
            ApplicationBootstrap bootstrap,
            ApplicationContext applicationContext,
            BackgroundTasks backgroundTasks)
        {
            var operationsOutputViewModel        = new OperationsOutputViewModel();
            var operationPropertiesViewModel     = new OperationPropertiesViewModel();
            var scriptOperationsViewModel        = new ScriptOperationsViewModel(operationPropertiesViewModel);
            var operationsViewModel              = new OperationsViewModel(operationPropertiesViewModel);
            var operationViewsViewModel          = new OperationViewsViewModel(new OperationsViewInitialization[] { operationsViewModel, scriptOperationsViewModel });
            var componentInstancesViewModel      = new ComponentInstancesViewModel(operationsViewModel, operationViewsViewModel);
            var operationMachinesByControlObject = new OperationMachinesByControlObject();
            var outputFactory = new OutputFactory(operationsOutputViewModel);
            var testComponentViewModelFactory =
                new TestComponentViewModelFactory(
                    componentInstancesViewModel,
                    outputFactory,
                    new WpfOperationViewModelFactory(applicationContext, scriptOperationsViewModel, new PropertySetBuilderFactory()),
                    backgroundTasks,
                    operationMachinesByControlObject,
                    bootstrap);
            var componentsViewModel = new ComponentsViewModel(testComponentViewModelFactory);

            var topMenuBarViewModel = new TopMenuBarViewModel(
                componentInstancesViewModel,
                operationsOutputViewModel, new PersistentModelContentBuilderFactory(operationsOutputViewModel, operationMachinesByControlObject));

            var factoryRepositories = componentLocation.LoadComponentRoots();

            AddAllInstanceFactories(factoryRepositories, componentsViewModel);

            bootstrap.SetOperationPropertiesViewDataContext(operationPropertiesViewModel);
            bootstrap.SetTopMenuBarContext(topMenuBarViewModel);
            bootstrap.SetOperationsViewDataContext(operationsViewModel);
            bootstrap.SetScriptOperationsViewDataContext(scriptOperationsViewModel);
            bootstrap.SetOperationsOutputViewDataContext(operationsOutputViewModel);
            bootstrap.SetComponentsViewDataContext(componentsViewModel);
            bootstrap.SetComponentInstancesViewDataContext(componentInstancesViewModel);
            bootstrap.SetOperationsViewsViewDataContext(operationViewsViewModel);
            return;
        }
Exemple #3
0
 public PersistentModelContentBuilderFactory(OperationsOutputViewModel operationsOutputViewModel, OperationMachinesByControlObject operationMachinesByControlObject)
 {
     _operationsOutputViewModel        = operationsOutputViewModel;
     _operationMachinesByControlObject = operationMachinesByControlObject;
 }