Class NodeExpandable
Class NodeExpandable. Implements the NodeExpandable
Inherited Members
Namespace: Mechatronics.SystemGraph
Syntax
[Serializable]
public class NodeExpandable : NodeRuntime
Fields
_portMap
The port map
Declaration
protected Dictionary<string, IPortType> _portMap
Field Value
| Type | Description |
|---|---|
| Dictionary<String, IPortType> |
Properties
PortList
Gets the port list.
Declaration
public IList<PortData> PortList { get; }
Property Value
| Type | Description |
|---|---|
| IList<PortData> | The port list. |
PortMap
Gets the port map.
Declaration
public Dictionary<string, IPortType> PortMap { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<String, IPortType> | The port map. |
Methods
GetAllowedPortTypes()
Called from the editor to get the allowed port types override the function to return a custom list of ports to add.
Declaration
public virtual IEnumerable<Type> GetAllowedPortTypes()
Returns
| Type | Description |
|---|---|
| IEnumerable<Type> | Enumerator of allowed types |
GetDynamicPort(String)
Gets the dynamic port.
Declaration
public IPortType GetDynamicPort(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The name. |
Returns
| Type | Description |
|---|---|
| IPortType | IPortType. |
GetDynamicPort<T>(String)
Gets the dynamic port.
Declaration
public T GetDynamicPort<T>(string name)
where T : class
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The name. |
Returns
| Type | Description |
|---|---|
| T | T. |
Type Parameters
| Name | Description |
|---|---|
| T |
OnPortAdded(String, Type, String, PortDirection, FieldExtra, ref IPortType)
PortAddition event received from the editor during edit mode if ExpandablePorts attribute is set. By default this function will accept all ports.
Declaration
public override bool OnPortAdded(string entryName, Type portType, string tooltip, PortDirection direction, FieldExtra extra, ref IPortType portReference)
Parameters
| Type | Name | Description |
|---|---|---|
| String | entryName | The name of the new port |
| Type | portType | Type of the port object |
| String | tooltip | The tooltip. |
| PortDirection | direction | The direction. |
| FieldExtra | extra | The extra. |
| IPortType | portReference | The port reference. |
Returns
| Type | Description |
|---|---|
| Boolean | Returns true if the port is accepted |
Overrides
OnPortRemoved(String)
Port removal event recieved from the editor during edit mode if ExpandablePorts attribute is set. By default this function will reject all removeals
Declaration
public override bool OnPortRemoved(string entryName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | entryName | The name of the port to remove |
Returns
| Type | Description |
|---|---|
| Boolean | Returns true if the port is removed |
Overrides
UpdatePortMap()
Updates the port map.
Declaration
public void UpdatePortMap()