コード例 #1
0
        //-------------------------------------------------------------------------

        // maxCharsBeforeWrappingText: Set to 0 for no wrapping.

        public Node AddNode(int id,
                            string header,
                            string title,
                            string text,
                            int maxCharsBeforeWrappingText,
                            Color colour,
                            Node.NodeShape shape)
        {
            if (Nodes.ContainsKey(id) == false)
            {
                title = WrapText(title, maxCharsBeforeWrappingText, "CENTER");
                text  = WrapText(text, maxCharsBeforeWrappingText, "LEFT");

                string nodeText = $"<SUP>{header}</SUP><BR ALIGN='CENTER' /><B>{title}</B>";

                if (text.Any())
                {
                    nodeText = $"{nodeText}<BR ALIGN='CENTER' />{text}";
                }

                Node newNode =
                    new Node(
                        id,
                        $"{nodeText}<br/>&nbsp;",
                        colour,
                        shape);

                Nodes.Add(id, newNode);

                return(newNode);
            }

            return(Nodes[id]);
        }
コード例 #2
0
ファイル: GraphVizDiagram.cs プロジェクト: grae22/Roadmap
        //-------------------------------------------------------------------------

        // maxCharsBeforeWrappingText: Set to 0 for no wrapping.

        public Node AddNode(int id,
                            string title,
                            string text,
                            int maxCharsBeforeWrappingText,
                            Color colour,
                            Node.NodeShape shape)
        {
            if (Nodes.ContainsKey(id) == false)
            {
                title = WrapText(title, maxCharsBeforeWrappingText, "CENTER");
                text  = WrapText(text, maxCharsBeforeWrappingText, "LEFT");

                // Create new node.
                Node newNode =
                    new Node(
                        id,
                        title + "<BR ALIGN='CENTER' />" + text,
                        colour,
                        shape);

                Nodes.Add(id, newNode);

                return(newNode);
            }

            return(Nodes[id]);
        }