Exemplo n.º 1
0
        public ProblemViewModel(MainViewModel mainViewModel, string problemPath)
        {
            _mainViewModel = mainViewModel;
            ProblemPath = problemPath;
            _testsPath = Path.ChangeExtension(ProblemPath, "txt");
            CompilerExecutablePath = Path.Combine(Path.GetTempPath(), string.Format("{0}.exe", Path.GetFileNameWithoutExtension(problemPath)));

            State = new StateViewModel();
            Tests = new ObservableCollection<TestViewModel>();

            FileChangesTracker.Instance.FileChanged += Instance_FileChanged;

            _compiler = CompilerSelector.Instance.GetCompiler(this);

            UpdateSource()
                .OnComplete(res =>
                    {
                        if (res == null) UpdateTests();
                    });
        }
Exemplo n.º 2
0
 private void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     DataContext = _viewModel = new MainViewModel();
     _viewModel.Init();
 }