// // SolutionObjectModel.cs - provides an ObjectModel for manipulating a collection of ProjectObjectModels in a Solution // // Author: // Michael Becker // // Copyright (c) 2011-2020 Mike Becker's Software // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . using System; using UniversalEditor.ObjectModels.Project; namespace UniversalEditor.ObjectModels.Solution { /// /// Provides an for manipulating a collection of s in a Solution. /// public class SolutionObjectModel : ObjectModel { private static ObjectModelReference _omr = null; protected override ObjectModelReference MakeReferenceInternal() { if (_omr == null) { _omr = base.MakeReferenceInternal(); _omr.Path = new string[] { "General", "Solution" }; } return _omr; } public override void Clear() { Configuration.Clear(); Projects.Clear(); Title = String.Empty; } public override void CopyTo(ObjectModel where) { SolutionObjectModel solution = (where as SolutionObjectModel); solution.Title = (Title.Clone() as string); foreach (ProjectObjectModel project in Projects) { solution.Projects.Add(project); } Configuration.CopyTo(solution.Configuration); } /// /// Gets a collection of instances representing the projects contained within this solution. /// /// The projects contained within this solution. public ProjectObjectModel.ProjectObjectModelCollection Projects { get; } = new ProjectObjectModel.ProjectObjectModelCollection(); /// /// Gets or sets the title of this . /// /// The title of this . public string Title { get; set; } = String.Empty; /// /// Gets a containing configuration information for this . /// /// The containing configuration information for this . public PropertyList.PropertyListObjectModel Configuration { get; } = new PropertyList.PropertyListObjectModel(); } }