using System.Collections.Generic; using DelftTools.Utils.Aop; using DelftTools.Utils.Collections.Generic; namespace DelftTools.Shell.Core { /// /// Container of all data and tasks. /// [Entity(FireOnCollectionChange = false)] public class Project : IObservable { /// /// 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) { Name = name; Items = new EventedList(); } /// /// Gets or sets a readable name of the project. /// public string Name { get; set; } /// /// Gets or sets description of the project. /// public string Description { get; set; } /// /// The items in the project. /// public IEventedList Items { get; private set; } /// /// True if project has changes. /// public bool IsChanged { get; set; } /// /// True if project is temporary. /// public bool IsTemporary { get; set; } # 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 } }