예제 #1
0
        /// <summary>
        /// Saves the solution file.
        /// </summary>
        /// <param name = "reporter">The progress reporter to use for logging.</param>
        public override void Save(IProgressReporter reporter)
        {
            reporter.ProgressVisible = true;
            for (int i = 0; i < Nodes.Count; i++)
            {
                reporter.Report("Saving {0}.", Nodes[i].Name);
                Nodes[i].Save(reporter);
                //progressReporter.ProgressPercentage = (int)(((double)Nodes.Count / (double)i) * 100);
            }

            reporter.Report("Writing solution file.");

            using (var writer = new StreamWriter(FilePath.FullPath))
            {
                using (var solutionWriter = new SolutionWriter(writer))
                {
                    solutionWriter.WriteSolution(this);
                }
            }

            reporter.Report("Writing solution settings.");

            Settings.Save(FilePath.ChangeExtension(".litesettings").FullPath);

            reporter.Report("Finished saving solution.");
            reporter.ProgressVisible = false;
            HasUnsavedData           = false;
        }
예제 #2
0
        /// <summary>
        /// Saves the solution file.
        /// </summary>
        /// <param name = "reporter">The progress reporter to use for logging.</param>
        public override void Save(IProgressReporter reporter)
        {
            reporter.ProgressVisible = true;
            for (int i = 0; i < Nodes.Count; i++)
            {
                reporter.Report("Saving {0}.", Nodes[i].Name);
                Nodes[i].Save(reporter);
                //progressReporter.ProgressPercentage = (int)(((double)Nodes.Count / (double)i) * 100);
            }

            reporter.Report("Writing solution file.");

            using (var writer = new StreamWriter(FilePath.FullPath))
            {
                using (var solutionWriter = new SolutionWriter(writer))
                {
                    solutionWriter.WriteSolution(this);
                }
            }

            reporter.Report("Writing solution settings.");

            Settings.Save(FilePath.ChangeExtension(".litesettings").FullPath);

            reporter.Report("Finished saving solution.");
            reporter.ProgressVisible = false;
            HasUnsavedData = false;
        }