SequenceDiagram Class

A sequence diagram: participants side by side, with their lifelines, and the messages they exchange over time, from the top to the bottom, with activations, notes and blocks such as loops and alternatives (Mermaid sequenceDiagram).

public sealed class SequenceDiagram : Diagram
Inheritance
Diagram SequenceDiagram

Constructors

NameDescription
SequenceDiagram()

SequenceDiagram()

SequenceDiagram.cs
public SequenceDiagram()

No documentation is available.

Properties

NameDescription
BoxesGets the boxes that group participants.
MirrorParticipantsGets or sets a value that indicates whether the participants are drawn below the lifelines too. The default is true (Mermaid mirrorActors).
ParticipantsGets the participants, from left to right. A participant that a message creates is in this list too.
StepsGets the steps of the diagram, from the top to the bottom: messages, notes, activations, blocks...

Gets the boxes that group participants.

public IList<SequenceBox> Boxes { get; }

Property value

IList<SequenceBox>

MirrorParticipants

SequenceDiagram.cs

Gets or sets a value that indicates whether the participants are drawn below the lifelines too. The default is true (Mermaid mirrorActors).

public bool MirrorParticipants { get; set; }

Property value

bool

Participants

SequenceDiagram.cs

Gets the participants, from left to right. A participant that a message creates is in this list too.

public IList<SequenceParticipant> Participants { get; }

Gets the steps of the diagram, from the top to the bottom: messages, notes, activations, blocks...

public IList<SequenceStep> Steps { get; }

Property value

IList<SequenceStep>

Methods

NameDescription
AddBlock(SequenceBlockKind, DiagramText?)Adds a block, such as a loop or an alternative, with its first section.
AddMessage(SequenceParticipant, SequenceParticipant, DiagramText?, SequenceLineStyle)Adds a message, with an arrowhead at the target.
AddNote(DiagramText, SequenceNotePosition, SequenceParticipant[])Adds a note.
AddParticipant(string, DiagramText?, SequenceParticipantKind)Adds a participant.
EnumerateSteps()Enumerates the steps and the steps of the blocks, depth first, in order.
Find(string)Finds a participant by identifier.

AddBlock(SequenceBlockKind, DiagramText?)

SequenceDiagram.cs

Adds a block, such as a loop or an alternative, with its first section.

public SequenceBlock AddBlock(SequenceBlockKind kind, DiagramText? label = null)

Parameters

kind SequenceBlockKind
The kind.
label DiagramText?
The text of the first section, or null for none.

Returns

SequenceBlock The block.

AddMessage(SequenceParticipant, SequenceParticipant, DiagramText?, SequenceLineStyle)

SequenceDiagram.cs

Adds a message, with an arrowhead at the target.

public SequenceMessage AddMessage(SequenceParticipant from, SequenceParticipant to, DiagramText? text = null, SequenceLineStyle lineStyle = SequenceLineStyle.Solid)

Parameters

from SequenceParticipant
The sender.
to SequenceParticipant
The receiver, which can be the sender.
text DiagramText?
The text.
lineStyle SequenceLineStyle
The style of the line.

Returns

SequenceMessage The message.

AddNote(DiagramText, SequenceNotePosition, SequenceParticipant[])

SequenceDiagram.cs

Adds a note.

public SequenceNote AddNote(DiagramText text, SequenceNotePosition position, params SequenceParticipant[] participants)

Parameters

text DiagramText
The text.
position SequenceNotePosition
Where the note is, relative to the participants.
participants SequenceParticipant[]
One participant, or two for a note over both.

Returns

SequenceNote The note.

AddParticipant(string, DiagramText?, SequenceParticipantKind)

SequenceDiagram.cs

Adds a participant.

public SequenceParticipant AddParticipant(string id, DiagramText? label = null, SequenceParticipantKind kind = SequenceParticipantKind.Participant)

Parameters

id string
The identifier, which is shown when there is no label.
label DiagramText?
The name shown, or null to show the identifier.
kind SequenceParticipantKind
How the participant is drawn.

Returns

SequenceParticipant The participant.

EnumerateSteps()

SequenceDiagram.cs

Enumerates the steps and the steps of the blocks, depth first, in order.

public IEnumerable<SequenceStep> EnumerateSteps()

Returns

IEnumerable<SequenceStep> The steps.

Find(string)

SequenceDiagram.cs

Finds a participant by identifier.

public SequenceParticipant? Find(string id)

Parameters

id string
The identifier.

Returns

SequenceParticipant? The participant, or null when there is none.