private void DrawAllDiagramElements(SequenceDiagram sequenceDiagram)
 {
     foreach (var cont in sequenceDiagram.Content)
     {
         DrawDiagramElement(cont);
     }
 }
 private void DrawAllNodes(SequenceDiagram sequenceDiagram)
 {
     foreach (var node in sequenceDiagram.Nodes)
     {
         _diagramSize = DrawNode(_diagramSize, node);
     }
 }
 private void DrawAllNodes(SequenceDiagram sequenceDiagram)
 {
     foreach (var node in sequenceDiagram.Nodes)
     {
         DrawNode(node);
     }
 }
        public SequenceDiagram CreateSequenceDiagram()
        {
            if(!IsSequenceDiagramEmpty())
            {
                _sequenceDiagram = new SequenceDiagram(_sdRepository);

                CreateStartNode(_method.DeclaringType.Identifier, _method.Name, _method.Identifier);
                ParseAllCalls(_method.Calls);
                CreateReturn(_method);
            }

            return _sequenceDiagram;
        }
        public SvgRoot RenderDiagram(SequenceDiagram sequenceDiagram)
        {
            _nodeMiddlePoints = new Dictionary<Guid, double>();
            _diagramSize = new Size(0.5, 80.5);
            _svgRoot = new SvgRoot(0, 0);

            DrawAllNodes(sequenceDiagram);
            DrawAllDiagramElements(sequenceDiagram);
            DrawVerticalLines(sequenceDiagram);

            _svgRoot.Height = _diagramSize.Height;
            _svgRoot.Width = _diagramSize.Width;

            return _svgRoot;
        }
        public DrawingVisual RenderDiagram(SequenceDiagram sequenceDiagram)
        {
            _nodeMiddlePoints = new Dictionary<Guid, double>();
            _diagramSize = new Size(0.5, 80.5);

            var canvas = new DrawingVisual();
            _context = canvas.RenderOpen();

            DrawAllNodes(sequenceDiagram);
            DrawAllDiagramElements(sequenceDiagram);
            DrawVerticalLines(sequenceDiagram);

            _context.Close();
            return canvas;
        }
        private void DrawVerticalLines(SequenceDiagram sequenceDiagram)
        {
            foreach (var node in _nodeMiddlePoints)
            {
                var path = new SvgPath(_svgRoot, string.Format("M{0},{1}L{0},{2}", 
                    node.Value.ToString("0.50", CultureInfo.InvariantCulture), 
                    45, 
                    _diagramSize.Height.ToString("0.50", CultureInfo.InvariantCulture)));
                path.StrokeWidth = 1;
                path.Stroke = "#979797";

                _svgGraphic.Add(path);
            }
        }
 private void DrawVerticalLines(SequenceDiagram sequenceDiagram)
 {
     foreach (var node in _nodeMiddlePoints)
     {
         _context.DrawLine(new Pen(Brushes.Black, 1), new Point(node.Value, 45), new Point(node.Value, _diagramSize.Height));
     }
 }