ClassDiagramClass Class

A class of a class diagram: a box with its name, its annotations, its attributes and its methods.

public sealed class ClassDiagramClass : ClassDiagramElement
Inheritance
ClassDiagramElement ClassDiagramClass

Constructors

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

ClassDiagramClass(string, DiagramText?)

ClassDiagramClass.cs

Initializes a new instance of the ClassDiagramClass class.

public ClassDiagramClass(string id, DiagramText? label = null)

Parameters

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

Properties

NameDescription
AnnotationsGets the annotations of the class, shown above its name between guillemets, such as interface (Mermaid <<interface>>).
GenericTypeGets or sets the generic type of the class, shown between angle brackets after its name, such as T (Mermaid Square~T~).
MembersGets the attributes and the methods, in order. The attributes are drawn above the methods.

Gets the annotations of the class, shown above its name between guillemets, such as interface (Mermaid <<interface>>).

public IList<string> Annotations { get; }

Property value

IList<string>

Gets or sets the generic type of the class, shown between angle brackets after its name, such as T (Mermaid Square~T~).

public string? GenericType { get; set; }

Property value

string?

Gets the attributes and the methods, in order. The attributes are drawn above the methods.

public IList<ClassMember> Members { get; }

Property value

IList<ClassMember>

Methods

NameDescription
AddMember(string, ClassMemberVisibility)Adds an attribute or a method.

AddMember(string, ClassMemberVisibility)

ClassDiagramClass.cs

Adds an attribute or a method.

public ClassMember AddMember(string text, ClassMemberVisibility visibility = ClassMemberVisibility.None)

Parameters

text string
The member, such as String name or getName() String: a text with parentheses is a method.
visibility ClassMemberVisibility
The visibility.

Returns

ClassMember The member.