Ejemplo n.º 1
0
        private double RenderRowSection(List<ClassDiagramRow> classDiagramRows, string memberType, double position, bool renderLine)
        {
            var actualPosition = position;
            foreach (var row in classDiagramRows)
            {
                var image = new SvgImage(_svgRoot, 15, actualPosition - 12, 16, 16, string.Format("data:image/png;base64,{0}", Icons.GetBase64Icon(row.Type, row.Accessibility)));
                var text = new SvgLink(_svgRoot, row.Text, string.Format("{{{{{0}-link:{1}}}}}", memberType, row.Identifier), 40, actualPosition);
                text.Text.FontSize = 14;

                _svgRoot.AppendChild(image.XmlElement);
                _svgRoot.AppendChild(text.XmlElement);

                actualPosition += 25;
            }

            if (classDiagramRows.Count > 0 && renderLine)
            {
                actualPosition -= 10;
                actualPosition = RenderLine(actualPosition);
            }

            return actualPosition;
        }
Ejemplo n.º 2
0
        private void RenderRowSection(List<ClassDiagramRow> classDiagramRows, string memberType, int rowCountOffset, int sectionOffset)
        {
            for (int i = 0; i < classDiagramRows.Count; i++)
            {
                var image = new SvgImage(
                    _svgRoot, 
                    15, 
                    FIRSTROW_OFFSET_Y + ((i + rowCountOffset) * 25) + (sectionOffset * 10) - 12, 
                    16, 
                    16,
                    string.Format("data:image/png;base64,{0}", Icons.GetBase64Icon(classDiagramRows[i].Type, classDiagramRows[i].Accessibility)));

                SvgElement text;
                if (_classDiagram.IsProjectStranger)
                {
                    text = new SvgText(
                        _svgRoot,
                        classDiagramRows[i].Text,
                        40,
                        FIRSTROW_OFFSET_Y + ((i + rowCountOffset) * 25) + (sectionOffset * 10));
                    ((SvgText)text).FontSize = 14;
                }
                else
                {
                    text = new SvgLink(
                        _svgRoot,
                        classDiagramRows[i].Text,
                        string.Format("{{{{{0}-link:{1}}}}}", memberType, classDiagramRows[i].Identifier),
                        40,
                        FIRSTROW_OFFSET_Y + ((i + rowCountOffset) * 25) + (sectionOffset * 10));
                    ((SvgLink)text).Text.FontSize = 14;
                }

                _svgGraphic.Add(image);
                _svgGraphic.Add(text);
            }

            if (classDiagramRows.Count > 0 && FollowingSectionsNotEmpty(memberType))
            {
                RenderLine(FIRSTROW_OFFSET_Y + ((classDiagramRows.Count + rowCountOffset) * 25) + (sectionOffset * 10) - 10);
            }
        }