ModularList

References
public sealed class ModularList
An array of input or output parameters of a ModularComponent which maintains the hidden/shown states of the optional parameters.

Constructors

ModularList

#
public ModularList(ModularComponent component, bool input)
component (ModularComponent)
input (bool)

Properties

AllParameters

#
public IEnumerable<IParameter> AllParameters { get; }
Enumerate over all parameters.

Categories

#
public IEnumerable<IParameter[]> Categories { get; }
Enumerate over all parameter categories. Parameters are grouped if they're optional and share the same __Category custom value.

Count

#
public int Count { get; }
The total number of parameters.

HiddenParameters

#
public IEnumerable<IParameter> HiddenParameters { get; }
Enumerate over only hidden parameters.

OptionalParameters

#
public IEnumerable<IParameter> OptionalParameters { get; }
Enumerate over all optional parameters. An optional parameter must have a TRUE value in the CustomValues stored under ModularComponent.__Optional.

VisibleCount

#
public int VisibleCount { get; }
The number of visible parameters.

VisibleParameters

#
public IEnumerable<IParameter> VisibleParameters { get; }
Enumerate over only visible parameters.

Indexers

this[]

#
public IParameter this[int index] { get; }
Gets or sets whether the parameter with the given index is visible.
index (int)

Methods

Hide

#
public void Hide(int index, ActionList undo = null)
Hide the parameter at the given index. This is only possible if the parameter is optional. Any wires currently connected to the parameter are severed (with the disconnections added to the undo list) and the connection data is cached in the parameter's CustomValues so that the wires can be reinstated when the parameter is shown again.
index (int)Index of the parameter to hide.
undo (ActionList = null)Optional undo list. Wire disconnection actions and the visibility/cache state change action are added here.

IndexOf

#
public int IndexOf(IParameter parameter)
parameter (IParameter)

IsOptional

#
public static bool IsOptional(IParameter parameter)
parameter (IParameter)

IsVisible

#
public bool IsVisible(int index)
Gets whether the parameter with the given index is visible.
index (int)

ResolveCategory

#
public static bool ResolveCategory(IParameter parameter, out string category)
parameter (IParameter)
category (out string)

ResolveColour

#
public static bool ResolveColour(IParameter parameter, out Color colour)
parameter (IParameter)
colour (out Color)

ResolveIcon

#
public static bool ResolveIcon(IParameter parameter, Type targetType, out IIcon icon)
parameter (IParameter)
targetType (Type)
icon (out IIcon)

ResolveName

#
public static bool ResolveName(IParameter parameter, out string name)
parameter (IParameter)
name (out string)

Restore

#
public bool Restore(IReader reader)
reader (IReader)

Show

#
public void Show(int index, ActionList undo = null)
Show the parameter at the given index. If the parameter has a cached list of wires recorded from a previous hide operation, those wires are reinstated where possible. Any wires successfully reconnected are appended to the undo list.
index (int)Index of the parameter to show.
undo (ActionList = null)Optional undo list. Wire reconnection actions and the visibility/cache state change action are added here.

Store

#
public void Store(IWriter writer)
writer (IWriter)

Events

Hidden

#
Events raised when a modular parameter is hidden.

Shown

#
Events raised when a modular parameter is shown.