DiagramText Class

The text of a label of a diagram: plain text, or markdown with bold and italic parts.

public sealed class DiagramText : IEquatable<DiagramText>
Implements

Constructors

NameDescription
DiagramText(string, DiagramTextFormat)Initializes a new instance of the DiagramText class.

DiagramText(string, DiagramTextFormat)

DiagramText.cs

Initializes a new instance of the DiagramText class.

public DiagramText(string text, DiagramTextFormat format = DiagramTextFormat.Plain)

Parameters

text string
The text. A line feed starts a new line.
format DiagramTextFormat
How the text is read.

Properties

NameDescription
FormatGets how the text is read.
IsEmptyGets a value that indicates whether the text is empty.
TextGets the text.

Gets how the text is read.

public DiagramTextFormat Format { get; }

Property value

DiagramTextFormat

Gets a value that indicates whether the text is empty.

public bool IsEmpty { get; }

Property value

bool

Gets the text.

public string Text { get; }

Property value

string

Methods

NameDescription
Equals(DiagramText?)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Determines whether the specified object is equal to the current object.
GetHashCode()Serves as the default hash function.
Markdown(string)Creates a markdown text.
ToString()Returns the text.

Equals overloads

Equals(DiagramText?)

DiagramText.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(DiagramText? other)
Parameters
other DiagramText?
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

DiagramText.cs

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current object.
Returns

bool true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

DiagramText.cs

Serves as the default hash function.

public override int GetHashCode()

Returns

int A hash code for the current object.

Markdown(string)

DiagramText.cs

Creates a markdown text.

public static DiagramText Markdown(string text)

Parameters

text string
The markdown.

Returns

DiagramText The text.

ToString()

DiagramText.cs

Returns the text.

public override string ToString()

Returns

string The text.

Operators

NameDescription
implicit operator DiagramText?(string?)Converts a text to a plain DiagramText.

implicit operator DiagramText?(string?)

DiagramText.cs

Converts a text to a plain DiagramText.

public static implicit operator DiagramText?(string? text)

Parameters

text string?
The text, or null.

Returns

DiagramText?