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
ClassDiagramElementClassDiagramClass
Constructors
| Name | Description |
|---|---|
| ClassDiagramClass(string, DiagramText?) | Initializes a new instance of the ClassDiagramClass class. |
ClassDiagramClass(string, DiagramText?)
ClassDiagramClass.csInitializes a new instance of the ClassDiagramClass class.
public ClassDiagramClass(string id, DiagramText? label = null)Parameters
idstring- The identifier, which is the name shown when there is no label.
labelDiagramText?- The name shown, or
nullto show the identifier.
Properties
| Name | Description |
|---|---|
| Annotations | Gets the annotations of the class, shown above its name between guillemets, such as interface (Mermaid <<interface>>). |
| GenericType | Gets or sets the generic type of the class, shown between angle brackets after its name, such as T (Mermaid Square~T~). |
| Members | Gets the attributes and the methods, in order. The attributes are drawn above the methods. |
Annotations
ClassDiagramClass.csGets the annotations of the class, shown above its name between guillemets, such as interface (Mermaid <<interface>>).
Property value
GenericType
ClassDiagramClass.csMembers
ClassDiagramClass.csGets the attributes and the methods, in order. The attributes are drawn above the methods.
public IList<ClassMember> Members { get; }Property value
Methods
| Name | Description |
|---|---|
| AddMember(string, ClassMemberVisibility) | Adds an attribute or a method. |
AddMember(string, ClassMemberVisibility)
ClassDiagramClass.csAdds an attribute or a method.
public ClassMember AddMember(string text, ClassMemberVisibility visibility = ClassMemberVisibility.None)Parameters
textstring- The member, such as
String nameorgetName() String: a text with parentheses is a method. visibilityClassMemberVisibility- The visibility.
Returns
ClassMember The member.