예제 #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 void CopyFrom(DiagramLibrary diagramLibrary)
        {
            if (null == diagramLibrary)
            {
                throw new ArgumentNullException("diagramLibrary");
            }

            foreach (KeyValuePair <string, DiagramCollection> sourceKVP in diagramLibrary.GetAll())
            {
                DiagramCollection collection = null;

                if (!TryGet(sourceKVP.Key, out collection))
                {
                    collection = Add(sourceKVP.Key);
                }

                collection.Add(sourceKVP.Value);
            }
        }
예제 #5
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);
        }
예제 #6
0
 private DiagramLibraryNode(DiagramStyle parentStyle)
 {
     DiagramCollection = new DiagramCollection(parentStyle);
 }
예제 #7
0
 public bool TryGet(string name, out DiagramCollection diagramCollection)
 {
     return(TryGet(PathUtils.PathRoot, name, out diagramCollection));
 }