C4Relationship Class

A relationship of a C4 diagram: a line from an item to another, with its text and its technology.

public sealed class C4Relationship

Constructors

NameDescription
C4Relationship(C4Item, C4Item, DiagramText)Initializes a new instance of the C4Relationship class.

C4Relationship(C4Item, C4Item, DiagramText)

C4Relationship.cs

Initializes a new instance of the C4Relationship class.

public C4Relationship(C4Item from, C4Item to, DiagramText label)

Parameters

from C4Item
The source.
to C4Item
The target.
label DiagramText
The text.

Properties

NameDescription
DescriptionGets or sets the description, written to Mermaid but not drawn, or null for none.
FromGets the source.
KindGets or sets the kind, which sets the arrowheads. The direction hints of Mermaid (Rel_U...) do not move the items.
LabelGets or sets the text.
LabelOffsetXGets or sets how far the text is moved right from the middle of the line, in pixels.
LabelOffsetYGets or sets how far the text is moved down from the middle of the line, in pixels.
LinkGets or sets the address of the relationship, written to Mermaid but not drawn, or null for none.
StyleGets or sets the colors of the line (DiagramStyle.Stroke) and of the text (DiagramStyle.TextColor) (Mermaid UpdateRelStyle).
TagsGets or sets the tags, written to Mermaid but not drawn, or null for none.
TechnologyGets or sets the technology, shown between brackets below the text, or null for none.
ToGets the target.

Gets or sets the description, written to Mermaid but not drawn, or null for none.

public DiagramText? Description { get; set; }

Property value

DiagramText?

Gets the source.

public C4Item From { get; }

Property value

C4Item

Gets or sets the kind, which sets the arrowheads. The direction hints of Mermaid (Rel_U...) do not move the items.

public C4RelationshipKind Kind { get; set; }

Property value

C4RelationshipKind

Gets or sets the text.

public DiagramText Label { get; set; }

Property value

DiagramText

LabelOffsetX

C4Relationship.cs

Gets or sets how far the text is moved right from the middle of the line, in pixels.

public double LabelOffsetX { get; set; }

Property value

double

LabelOffsetY

C4Relationship.cs

Gets or sets how far the text is moved down from the middle of the line, in pixels.

public double LabelOffsetY { get; set; }

Property value

double

Gets or sets the colors of the line (DiagramStyle.Stroke) and of the text (DiagramStyle.TextColor) (Mermaid UpdateRelStyle).

public DiagramStyle? Style { get; set; }

Property value

DiagramStyle?

Gets or sets the tags, written to Mermaid but not drawn, or null for none.

public string? Tags { get; set; }

Property value

string?

Gets or sets the technology, shown between brackets below the text, or null for none.

public string? Technology { get; set; }

Property value

string?

Gets the target.

public C4Item To { get; }

Property value

C4Item