Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public Project GetProject()
        {
            var project = Project.Create();

            var glBuilder = project.GroupLibraries.ToBuilder();

            glBuilder.Add(GroupLibrary.Create("Default"));
            project.GroupLibraries = glBuilder.ToImmutable();

            var sgBuilder = project.StyleLibraries.ToBuilder();

            sgBuilder.Add(DefaultStyleLibrary());
            sgBuilder.Add(LinesStyleLibrary());
            sgBuilder.Add(TemplateStyleLibrary());
            project.StyleLibraries = sgBuilder.ToImmutable();

            project.CurrentGroupLibrary = project.GroupLibraries.FirstOrDefault();
            project.CurrentStyleLibrary = project.StyleLibraries.FirstOrDefault();

            var templateBuilder = project.Templates.ToBuilder();

            templateBuilder.Add(GetTemplate(project, "Empty"));
            templateBuilder.Add(CreateGridTemplate(project, "Grid"));
            project.Templates = templateBuilder.ToImmutable();

            project.CurrentTemplate = project.Templates.FirstOrDefault(t => t.Name == "Grid");

            var document  = GetDocument(project, "Document");
            var container = GetContainer(project, "Container");

            var containerBuilder = document.Containers.ToBuilder();

            containerBuilder.Add(container);
            document.Containers = containerBuilder.ToImmutable();

            var documentBuilder = project.Documents.ToBuilder();

            documentBuilder.Add(document);
            project.Documents = documentBuilder.ToImmutable();

            project.CurrentDocument  = project.Documents.FirstOrDefault();
            project.CurrentContainer = document.Containers.FirstOrDefault();

            return(project);
        }
Esempio n. 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="gl"></param>
        public void Add(GroupLibrary gl)
        {
            if (gl == null)
                return;

            if (gl.Groups != null)
            {
                Add(gl.Groups);
            }

            gl.PropertyChanged += GroupLibraryObserver;
            Verbose("Add Group Library: " + gl.Name);
        }
Esempio n. 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="gl"></param>
        public void Remove(GroupLibrary gl)
        {
            if (gl == null)
                return;

            if (gl.Groups != null)
            {
                Remove(gl.Groups);
            }

            gl.PropertyChanged -= GroupLibraryObserver;
            Verbose("Remove Group Library: " + gl.Name);
        }