Пример #1
0
        private void ProjectChanged(ProjectChangedEventArgs args)
        {
            for (int i = 0; i < Projects.Count; ++i)
            {
                if (Projects[i].Project == args.ChangedProject)
                {
                    Projects[i].RefreshOnProjectChanged(args);
                }
            }

            OnPropertyChanged("Projects");
        }
Пример #2
0
        /// <summary>
        /// Adds the inputted test result to this project and saves the file.
        /// Will also fire the ProjectChanged event.
        /// </summary>
        /// <param name="testResult"></param>
        public void AddTestResult(TestResult testResult)
        {
            TestResults.Add(testResult);
            Save();

            ProjectChangedEventArgs args = new ProjectChangedEventArgs(this, new List <TestResult>()
            {
                testResult
            }, new List <TestResult>());

            // Make sure to invoke the ProjectChanged event on the UI thread as it will be used to update UI.
            Application.Current.Dispatcher.Invoke(() => ProjectChanged?.Invoke(args));
        }