using System.Collections.Generic; using DelftTools.Utils.Aop; using DelftTools.Utils.Collections.Generic; using DelftTools.Utils.Data; namespace DelftTools.Shell.Core { /// /// Container of all data and tasks. /// [Entity(FireOnCollectionChange = false)] public class Project : EditableObjectUnique, IObservable { private string name; private string description; private bool isChanged; private bool isTemporary; private bool isMigrated; /// /// Creates instance of the Project. /// public Project() : this("Project") { } /// /// Creates instance of the Project using the supplied . /// /// Readable name of the project. public Project(string name) { this.name = name; Items = new EventedList(); } /// /// Gets or sets a readable name of the project. /// public string Name { get { return name; } set { name = value; } } /// /// Gets or sets description of the project. /// public string Description { get { return description; } set { description = value; } } /// /// The items in the project. /// public IEventedList Items { get; private set; } /// /// True if project has changes. /// public bool IsChanged { get { return isChanged; } set { isChanged = value; } } /// /// True if project is temporary. /// public bool IsTemporary { get { return isTemporary; } set { isTemporary = value; } } # region IObservable private readonly IList observers = new List(); public void Attach(IObserver observer) { observers.Add(observer); } public void Detach(IObserver observer) { observers.Remove(observer); } public void NotifyObservers() { foreach (var observer in observers) { observer.UpdateObserver(); } } # endregion } }