Exemplo n.º 1
0
        public void Update(ModelInitialization initialization)
        {
            Dictionary <Type, Initializer> fieldInitializers = GetFieldInitializers(initialization);

            Model = new OrdinalFieldViewModel(initialization.FieldParameters);
            Model.Initialize(fieldInitializers.Values);
            OnPropertyChanged(nameof(Model));
        }
        private void InitContexts(Solution solution)
        {
            LoadedClasses = new LoadedClasses(solution,
                                              messageService,
                                              dialogFactory);
            ModelInitialization            = new ModelInitialization(LoadedClasses);
            ModelRunner                    = new ModelRunner();
            ModelRunner.UserCodeException += UserCodeException;

            panelDataContexts[TaskSummaryStep]         = solution.Task;
            panelDataContexts[EditCodeStep]            = LoadedClasses;
            panelDataContexts[ModelInitializationStep] = ModelInitialization;
            panelDataContexts[ModelRunningStep]        = ModelRunner;
        }
 private void CompileClasses()
 {
     ModelInitialization
     .Update(LoadedClasses);
 }
Exemplo n.º 4
0
 private Dictionary <Type, Initializer> GetFieldInitializers(ModelInitialization initialization)
 {
     return(initialization.InitializersData
            .Select(pair => Initializer.FromInitializationData(pair.Value))
            .ToDictionary(initializer => initializer.ElementType));
 }