/// <inheritdoc />
        public void SaveProject(TestProject testProject, FileInfo testProjectFile)
        {
            if (testProject == null)
            {
                throw new ArgumentNullException("testProject");
            }
            if (testProjectFile == null)
            {
                throw new ArgumentNullException("testProjectFile");
            }

            var testProjectData = new TestProjectData(testProject);

            testProjectData.Validate(); // sanity check
            testProjectData.MakeRelativePaths(testProjectFile.DirectoryName);
            xmlSerializer.SaveToXml(testProjectData, testProjectFile.FullName);
        }
        public void SaveUserOptions(string projectName, IProgressMonitor subProgressMonitor)
        {
            if (unsavedChanges == false)
            {
                return;
            }

            var projectUserOptionsFile = projectName + UserOptions.Extension;
            var userOptions            = new UserOptions
            {
                TreeViewCategory = TreeViewCategory,
                CollapsedNodes   = new List <string>(CollapsedNodes)
            };

            xmlSerializer.SaveToXml(userOptions, projectUserOptionsFile);

            eventAggregator.Send(this, new UserOptionsSaved());
        }
Esempio n. 3
0
        public void Save()
        {
            try
            {
                // create folder, if necessary
                if (!fileSystem.DirectoryExists(Paths.IcarusAppDataFolder))
                {
                    fileSystem.CreateDirectory(Paths.IcarusAppDataFolder);
                }

                xmlSerializer.SaveToXml(settings, Paths.SettingsFile);

                eventAggregator.Send(this, new OptionsChanged());
            }
            catch (Exception ex)
            {
                unhandledExceptionPolicy.Report("An exception occurred while saving Icarus settings file.", ex);
            }
        }