StateDiagramState Class
A state of a state diagram. A state with regions is a composite state, drawn as a frame around them.
public sealed class StateDiagramStateConstructors
| Name | Description |
|---|---|
| StateDiagramState(string, DiagramText?, StateKind) | Initializes a new instance of the StateDiagramState class. |
StateDiagramState(string, DiagramText?, StateKind)
StateDiagramState.csInitializes a new instance of the StateDiagramState class.
public StateDiagramState(string id, DiagramText? label = null, StateKind kind = StateKind.Normal)Parameters
idstring- The identifier, unique in the diagram, which is the name shown when there is no label.
labelDiagramText?- The name shown, or
nullto show the identifier. kindStateKind- The kind of the state.
Properties
| Name | Description |
|---|---|
| CssClasses | Gets the CSS classes of the state: the names of styles of StateDiagram.ClassDefinitions. |
| Direction | Gets or sets the direction of the content of a composite state, or null for the direction of the diagram. As in Mermaid, it applies only when no transition crosses the border of the state. |
| Id | Gets the identifier of the state. |
| IsComposite | Gets a value that indicates whether the state has regions. |
| Kind | Gets or sets the kind of the state. |
| Label | Gets or sets the name shown, or null to show the identifier. |
| Regions | Gets the regions of a composite state: one for a composite state, several for concurrent parts (Mermaid --). |
| Style | Gets or sets the style of the state, which takes precedence over the style of its classes. |
CssClasses
StateDiagramState.csGets the CSS classes of the state: the names of styles of StateDiagram.ClassDefinitions.
Property value
Direction
StateDiagramState.csGets or sets the direction of the content of a composite state, or null for the direction of the diagram. As in Mermaid, it applies only when no transition crosses the border of the state.
public DiagramDirection? Direction { get; set; }Property value
IsComposite
StateDiagramState.csLabel
StateDiagramState.csGets or sets the name shown, or null to show the identifier.
public DiagramText? Label { get; set; }Property value
Regions
StateDiagramState.csGets the regions of a composite state: one for a composite state, several for concurrent parts (Mermaid --).
public IList<StateDiagramRegion> Regions { get; }Property value
Style
StateDiagramState.csGets or sets the style of the state, which takes precedence over the style of its classes.
public DiagramStyle? Style { get; set; }Property value
Methods
| Name | Description |
|---|---|
| AddState(string, DiagramText?, StateKind) | Adds a state to the last region of this state, which becomes a composite state. |
| ToString() | Returns the identifier of the state. |
AddState(string, DiagramText?, StateKind)
StateDiagramState.csAdds a state to the last region of this state, which becomes a composite state.
public StateDiagramState AddState(string id, DiagramText? label = null, StateKind kind = StateKind.Normal)Parameters
idstring- The identifier of the state, unique in the diagram.
labelDiagramText?- The name shown, or
nullto show the identifier. kindStateKind- The kind of the state.
Returns
StateDiagramState The state.