Ejemplo n.º 1
0
            public void Returns_Most_Recently_Set_Project_As_Root()
            {
                var root    = new DomainRoot();
                var project = new Project();

                root.SetRoot(project);

                Assert.AreEqual <Project>(project, root.GetRoot());
            }
        public void Save(IProject itemToUpdate)
        {
            if (itemToUpdate == null)
            {
                throw new ArgumentNullException("itemToUpdate");
            }

            if (_domainRoot.GetRoot() == null)
            {
                _domainRoot.SetRoot(new Project(itemToUpdate));
            }
            else
            {
                _domainRoot.GetRoot().CopyProjectPropertiesFrom(itemToUpdate);
            }

            var root = _domainRoot.GetRoot();

            var xmlRoot = BuildXmlStructureForProject(root);

            _document.Save(xmlRoot, root.ProjectPath);
        }
Ejemplo n.º 3
0
        public void SetModules(params IModule[] modules)
        {
            var root = _domainRoot.GetRoot();

            if (root == null)
            {
                root = new Project();
                _domainRoot.SetRoot(root);
            }

            root.ClearModules();

            foreach (var module in modules)
            {
                root.AddModule(new Module(module));
            }
        }