示例#1
0
        public DiagramCollection Clone()
        {
            DiagramCollection clone = new DiagramCollection(Style.Parent);

            foreach (Diagram diagram in this)
            {
                clone.Add(diagram.Clone());
            }

            return(clone);
        }
示例#2
0
        public DiagramCollection ToDiagramCollection(ChordFinderStyle chordFinderStyle)
        {
            DiagramCollection collection = new DiagramCollection(chordFinderStyle.Style);

            foreach (ChordFinderResult result in _results)
            {
                collection.Add(result.ToDiagram(chordFinderStyle));
            }

            return(collection);
        }
示例#3
0
        public void Add(DiagramCollection diagramCollection)
        {
            if (null == diagramCollection)
            {
                throw new ArgumentNullException(nameof(diagramCollection));
            }

            foreach (Diagram d in diagramCollection)
            {
                Add(d);
            }
        }
示例#4
0
        public bool TryGet(string path, string name, out DiagramCollection diagramCollection)
        {
            if (StringUtils.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            path = PathUtils.Clean(path);

            foreach (DiagramLibraryNode node in _nodes)
            {
                if (node.Name == name && node.Path == path)
                {
                    diagramCollection = node.DiagramCollection;
                    return(true);
                }
            }

            diagramCollection = null;
            return(false);
        }
示例#5
0
 private DiagramLibraryNode(DiagramStyle parentStyle)
 {
     DiagramCollection = new DiagramCollection(parentStyle);
 }
示例#6
0
 public bool TryGet(string name, out DiagramCollection diagramCollection)
 {
     return(TryGet(PathUtils.PathRoot, name, out diagramCollection));
 }