private void DrawDiagramElement(SequenceDiagramElement element)
        {
            var connection = element as SequenceDiagramConnection;
            if (connection != null && !connection.IsReturnConnection)
            {
                DrawConnection(connection);
            }
            else if (connection != null)
            {
                DrawReturnConnection(connection);
            }

            var composite = element as SequenceDiagramComposite;
            if (composite != null)
            {
                OpenBlock(composite);
                foreach (var cont in composite.Content)
                {
                    DrawDiagramElement(cont);
                }
                CloseBlock();
            }
        }
        private Size DrawDiagramElement(SequenceDiagramElement element, Size size)
        {
            var connection = element as SequenceDiagramConnection;
            if (connection != null && !connection.IsReturnConnection)
            {
                size = DrawConnection(size, connection);
            }
            else if (connection != null)
            {
                size = DrawReturnConnection(size, connection);
            }

            var composite = element as SequenceDiagramComposite;
            if (composite != null)
            {
                size = OpenBlock(composite, size);
                foreach (var cont in composite.Content)
                {
                    size = DrawDiagramElement(cont, size);
                }
                size = CloseBlock(size);
            }
            return size;
        }