Exemplo n.º 1
0
        /// <summary>
        /// Closes the project.
        /// </summary>
        public void Close()
        {
            // Can't close this when any project references this one
            if (Editor.Projects.Any(project => project.References.Contains(this)))
            {
                throw new InvalidOperationException("Cannot close project because it is referenced by other projects");
            }

            ProjectItems.ForEach(doc => doc.Close());
            Editor.projects.Remove(this);
            References.ForEach(project => project.Close());
            if (Editor.ActiveProject == this)
            {
                Editor.ActiveProject = null;
            }

            Trace.TraceInformation("Project {0} closed.", Name);
        }