Esempio n. 1
0
 public TestViewModel(string name, TestData testData, ProblemViewModel problem)
 {
     _testData = testData;
     _problem = problem;
     Name = name;
     State = new StateViewModel();
     State.PropertyChanged += State_PropertyChanged;
 }
Esempio n. 2
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();
                    });
        }