Ejemplo n.º 1
0
        public DiagramCollection Clone()
        {
            DiagramCollection clone = new DiagramCollection(Style.Parent);

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

            return(clone);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public void Add(DiagramCollection diagramCollection)
        {
            if (null == diagramCollection)
            {
                throw new ArgumentNullException(nameof(diagramCollection));
            }

            foreach (Diagram d in diagramCollection)
            {
                Add(d);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
 private DiagramLibraryNode(DiagramStyle parentStyle)
 {
     DiagramCollection = new DiagramCollection(parentStyle);
 }
Ejemplo n.º 7
0
 public bool TryGet(string name, out DiagramCollection diagramCollection)
 {
     return(TryGet(PathUtils.PathRoot, name, out diagramCollection));
 }