Class UmlClassMethod
Represents a method (operation) in a UML class.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.Diagram.dll
Syntax
public class UmlClassMethod : UmlClassAttribute, IDiagramObject, ICloneable
Remarks
This extends a typed UML element and includes support for parameters and return type, along with visibility scope and optional separator behavior.
Examples
nodes.Add(new Node()
{
Shape = new UmlClassifierShape()
{
Classifier = ClassifierShape.Class,
ClassShape = new UmlClass()
{
Name = "MathService",
Methods = new DiagramObjectCollection<UmlClassMethod>()
{
new UmlClassMethod()
{
Name = "Multiply",
Type = "int",
Scope = UmlScope.Public,
Parameters = new DiagramObjectCollection<UmlTypedElement>()
{
new UmlTypedElement() { Name = "a", Type = "int" },
new UmlTypedElement() { Name = "b", Type = "int" }
}
}
}
}
}
});
Constructors
UmlClassMethod()
Creates a new instance of the UmlClassMethod.
Declaration
public UmlClassMethod()
UmlClassMethod(UmlClassMethod)
Creates a new instance of the UmlClassMethod.
Declaration
public UmlClassMethod(UmlClassMethod src)
Parameters
| Type | Name | Description |
|---|---|---|
| UmlClassMethod | src | Source instance |
Properties
Parameters
Gets or sets the collection of parameters for the method.
Declaration
[JsonPropertyName("parameters")]
public DiagramObjectCollection<UmlTypedElement> Parameters { get; set; }
Property Value
| Type | Description |
|---|---|
| DiagramObjectCollection<UmlTypedElement> | A DiagramObjectCollection<T> representing the method parameters. |
Remarks
Each parameter is defined with a name, type, and optional text styling.
Examples
This example demonstrates how to define a method with parameters in a UML class node:
nodes.Add(new Node()
{
Shape = new UmlClassifierShape()
{
Classifier = ClassifierShape.Class,
ClassShape = new UmlClass()
{
Name = "Calculator",
Methods = new DiagramObjectCollection<UmlClassMethod>()
{
new UmlClassMethod()
{
Name = "Add",
Type = "int",
Scope = UmlScope.Public,
Parameters = new DiagramObjectCollection<UmlTypedElement>()
{
new UmlTypedElement() { Name = "x", Type = "int" },
new UmlTypedElement() { Name = "y", Type = "int" }
}
}
}
}
}
});
Methods
Clone()
This method releasing all unmanaged resources.
Declaration
public override object Clone()
Returns
| Type |
|---|
| object |