Esempio n. 1
0
        /// <summary>
        /// Opens an existing solution file and parses out the sub projects.
        /// </summary>
        /// <param name = "solutionFile">The file path to the solution file.</param>
        public static Solution OpenSolution(string solutionFile)
        {
            using (var reader = new StreamReader(solutionFile))
            {
                using (var solutionReader = new SolutionReader(reader))
                {
                    var solution = new Solution();
                    solution.FilePath = new FilePath(solutionFile);
                    solution.Name     = solution.FilePath.FileName;
                    solutionReader.InitializeSolution(solution);
                    solution.InitializeEventHandlers();

                    var settingsPath = solution.FilePath.ChangeExtension(".litesettings").FullPath;
                    if (File.Exists(settingsPath))
                    {
                        try
                        {
                            var settings = SolutionSettings.ReadSettings(settingsPath);
                            solution.Settings = settings;
                        }
                        catch
                        {
                            // TODO: notify user
                        }
                    }

                    return(solution);
                }
            }
        }
Esempio n. 2
0
 internal Solution()
 {
     GlobalSections = new EventBasedCollection <SolutionSection>();
     Settings       = new SolutionSettings();
     _invoker       = new MSBuildInvoker(this);
     _invoker.CompletedOperation += new BuildResultEventHandler(invoker_CompletedOperation);
 }
Esempio n. 3
0
 internal Solution()
 {
     GlobalSections = new EventBasedCollection<SolutionSection>();
     Settings = new SolutionSettings();
     _invoker = new MSBuildInvoker(this);
     _invoker.CompletedOperation += new BuildResultEventHandler(invoker_CompletedOperation);
 }