ComponentParameters

References
[IoId("00000000-1193-48a8-aaee-b330e55149a0")] public sealed class ComponentParameters : IEnumerable<IParameter>, IStorable
Implementation of IComponentParameters.

Constructors

ComponentParameters

#
public ComponentParameters(Component component)
Create a new instance of the ComponentParameters.
component (Component)Component which owns this instance.

Properties

Count

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

InputCount

#
public int InputCount { get; }
Gets the total number of input parameters.

Inputs

#
public IEnumerable<IParameter> Inputs { get; }
Enumerate over all inputs.

MetaMixingBehaviour

#
public MixingBehaviour MetaMixingBehaviour { get; set; }
Gets or sets how meta data is inherited by outputs from inputs.

MetaMixingRecipe

#
public MixingRecipe MetaMixingRecipe { get; set; }
Gets or sets the inheritance map for meta data on this component. Leave blank to use default inheritance logic. Setting this property will not expire the component or cause a new solution to be computed, those steps are the responsibility of the caller.

MetaMixingTable

#
public int[][] MetaMixingTable { get; }
Gets the meta data inheritance map resolved to valid indices. This is an array of length OutputCount where each entry lists all the input parameter indices that act as inheritance parents for each output.

OutputCount

#
public int OutputCount { get; }
Gets the total number of output parameters.

Outputs

#
public IEnumerable<IParameter> Outputs { get; }
Enumerate over all outputs.

Methods

AddInput

#
public void AddInput(IParameter parameter, ActionList undo)
Add an input parameter to the bottom of the list.
parameter (IParameter)Parameter to add.
undo (ActionList)Optional list of undo actions to populate.

AddInput

#
public void AddInput(IParameter parameter, int index, ActionList undo)
Insert an input parameter into the list.
parameter (IParameter)Parameter to insert.
index (int)Insertion index.
undo (ActionList)Optional list of undo actions to populate.

AddInput

#
public void AddInput(IParameter parameter, int index)
obsoleteUse the overload which records undo actions.
Insert an input parameter into the list.
parameter (IParameter)Parameter to insert.
index (int)Insertion index.

AddInput

#
public void AddInput(IParameter parameter)
obsoleteUse the overload which records undo actions.
Add an input parameter to the bottom of the list.
parameter (IParameter)Parameter to add.

AddOutput

#
public void AddOutput(IParameter parameter, ActionList undo)
Add an output parameter to the bottom of the list.
parameter (IParameter)Parameter to add.
undo (ActionList)Optional list of undo actions to populate.

AddOutput

#
public void AddOutput(IParameter parameter, int index, ActionList undo)
Insert an output parameter into the list.
parameter (IParameter)Parameter to insert.
index (int)Insertion index.
undo (ActionList)Optional list of undo actions to populate.

AddOutput

#
public void AddOutput(IParameter parameter, int index)
obsoleteUse the overload which records undo actions.
Insert an output parameter into the list.
parameter (IParameter)Parameter to insert.
index (int)Insertion index.

AddOutput

#
public void AddOutput(IParameter parameter)
obsoleteUse the overload which records undo actions.
Add an output parameter to the bottom of the list.
parameter (IParameter)Parameter to add.

AutoInputMaintenance

#
public void AutoInputMaintenance(string nameFormat, string infoFormat, string userFormat, Func<int, int> indexMap, Requirement requirement)
A utility method for processing all input parameters from within a Component.VariableParameterMaintenance() method.
nameFormat (string)String format for the nomen name. May contain '{index}', '{number}', and '{ordinal}' patterns.
infoFormat (string)String format for the nomen info. May contain '{index}', '{number}', and '{ordinal}' patterns.
userFormat (string)String format for the user name. May contain '{index}' pattern.
indexMap (Func<int, int>)Function for converting zero-based parameter indices into usage indices. May be null.
requirement (Requirement)Requirement to assign to each parameter.

AutoOutputMaintenance

#
public void AutoOutputMaintenance(string nameFormat, string infoFormat, string userFormat, Func<int, int> indexMap)
A utility method for processing all output parameters from within a Component.VariableParameterMaintenance() method.
nameFormat (string)String format for the nomen name. May contain '{index}', '{number}', and '{ordinal}' patterns.
infoFormat (string)String format for the nomen info. May contain '{index}', '{number}', and '{ordinal}' patterns.
userFormat (string)String format for the user name. May contain '{index}' pattern.
indexMap (Func<int, int>)Function for converting zero-based parameter indices into usage indices. May be null.

CreateUniqueInputName

#
public string CreateUniqueInputName(string format = "{0}", string symbols = "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
Create an input user name which isn't yet used in this instance.
format (string = "{0}")Name format.
symbols (string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ")Symbols to pick from.
Unique name.

CreateUniqueOutputName

#
public string CreateUniqueOutputName(string format = "{0}", string symbols = "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
Create an output user name which isn't yet used in this instance.
format (string = "{0}")Name format.
symbols (string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ")Symbols to pick from.
Unique name.

GetEnumerator

#
public IEnumerator<IParameter> GetEnumerator()
Returns an enumerator that iterates through the collection.
An enumerator that can be used to iterate through the collection.

GetInputStates

#
[EditorBrowsable(EditorBrowsableState.Never)] public void GetInputStates(out IParameter[] inputs, out Access[] access)
Get arrays describing the current input state.
inputs (out IParameter[])Input parameters.
access (out Access[])Access level for all inputs.

GetOutputStates

#
[EditorBrowsable(EditorBrowsableState.Never)] public void GetOutputStates(out IParameter[] outputs, out Access[] access)
Gets arrays describing the current output state.
outputs (out IParameter[])Output parameters.
access (out Access[])Access level for all outputs.

GetPinStates

#
[EditorBrowsable(EditorBrowsableState.Never)] public void GetPinStates(out IParameter[] pins)
Get arrays describing the current pinned states.
pins (out IParameter[])Pinned parameters.
Explicit

IStorable.Store

#
void IStorable.Store(IWriter writer)
writer (IWriter)
Store

IndexOfFirstInputOfType

#
public int IndexOfFirstInputOfType(Type parameterType, int fallback = -1)
Gets the index of the first input parameter whose type is compatible with the provided type.
parameterType (Type)Type filter.
fallback (int = -1)Index to return in case of no match.
Index of first parameter of type, or -1.

IndexOfFirstOutputOfType

#
public int IndexOfFirstOutputOfType(Type parameterType, int fallback = -1)
Gets the index of the first output parameter whose type is compatible with the provided type.
parameterType (Type)Type filter.
fallback (int = -1)Index to return in case of no match.
Index of first parameter of type, or -1.

IndexOfInput

#
public int IndexOfInput(Guid id)
Gets the index of the given parameter.
id (Guid)Parameter instanceId to search for.
Index or -1 if parameter is not an input.

IndexOfInput

#
public int IndexOfInput(IParameter parameter)
Gets the index of the given parameter.
parameter (IParameter)Parameter to search for.
Index or -1 if parameter is not an input.

IndexOfOutput

#
public int IndexOfOutput(Guid id)
Gets the index of the given parameter.
id (Guid)Parameter instanceId to search for.
Index or -1 if parameter is not an output.

IndexOfOutput

#
public int IndexOfOutput(IParameter parameter)
Gets the index of the given parameter.
parameter (IParameter)Parameter to search for.
Index or -1 if parameter is not an output.

Input

#
public IParameter Input(Guid id)
Gets the input parameter with the specified id.
id (Guid)Parameter instanceId.
Parameter with specified id.

Input

#
public IParameter Input(int index)
Gets the input parameter at the specified index.
index (int)Index of parameter to retrieve.
Parameter at index.

IsInput

#
public bool IsInput(Guid id)
Test whether a specific parameter is defined as an input.
id (Guid)Parameter instanceId to test for.
True if parameter is indeed an input.

IsInput

#
public bool IsInput(IParameter parameter)
Test whether a specific parameter is defined as an input.
parameter (IParameter)Parameter to test for.
True if parameter is indeed an input.

IsOutput

#
public bool IsOutput(Guid id)
Test whether a specific parameter is defined as an output.
id (Guid)Parameter instanceId to test for.
True if parameter is indeed an output.

IsOutput

#
public bool IsOutput(IParameter parameter)
Test whether a specific parameter is defined as an output.
parameter (IParameter)Parameter to test for.
True if parameter is indeed an output.

Output

#
public IParameter Output(Guid id)
Gets the output parameter with the specified id.
id (Guid)Parameter instanceId.
Parameter with specified id.

Output

#
public IParameter Output(int index)
Gets the output parameter at the specified index.
index (int)Index of parameter to retrieve.
Parameter at index.

RemoveInput

#
public void RemoveInput(int index, ActionList undo)
Remove the input parameter at the specified index.
index (int)Index of parameter to remove.
undo (ActionList)Optional list of undo actions to populate.

RemoveInput

#
public void RemoveInput(int index)
obsoleteUse the overload which records undo actions.
Remove the input parameter at the specified index.
index (int)Index of parameter to remove.

RemoveInput

#
public void RemoveInput(IParameter parameter, ActionList undo)
Remove the specified input parameter.
parameter (IParameter)Parameter to remove.
undo (ActionList)Optional list of undo actions to populate.

RemoveInput

#
public void RemoveInput(IParameter parameter)
obsoleteUse the overload which records undo actions.
Remove the specified input parameter.
parameter (IParameter)Parameter to remove.

RemoveOutput

#
public void RemoveOutput(int index, ActionList undo)
Remove the output parameter at the specified index.
index (int)Index of parameter to remove.
undo (ActionList)Optional list of undo actions to populate.

RemoveOutput

#
public void RemoveOutput(int index)
obsoleteUse the overload which records undo actions.
Remove the output parameter at the specified index.
index (int)Index of parameter to remove.

RemoveOutput

#
public void RemoveOutput(IParameter parameter, ActionList undo)
Remove the specified output parameter.
parameter (IParameter)Parameter to remove.
undo (ActionList)Optional list of undo actions to populate.

RemoveOutput

#
public void RemoveOutput(IParameter parameter)
obsoleteUse the overload which records undo actions.
Remove the specified output parameter.
parameter (IParameter)Parameter to remove.

Requirement

#
public Requirement Requirement(Guid id)
Gets the parameter requirement for a given input id.
id (Guid)Parameter instanceId.
Requirement.

Requirement

#
public Requirement Requirement(int index)
Gets the parameter requirement for a given input index.
index (int)Index of input parameter.
Requirement.

Restore

#
public void Restore(IReader reader)
reader (IReader)

SortInputs

#
public void SortInputs(double[] keys)
Sort the input parameters based on keys. This method fails silently.
keys (double[])

SortInputs

#
public void SortInputs(int[] keys)
Sort the input parameters based on keys. This method fails silently.
keys (int[])

SortOutputs

#
public void SortOutputs(double[] keys)
Sort the output parameters based on keys. This method fails silently.
keys (double[])

SortOutputs

#
public void SortOutputs(int[] keys)
Sort the output parameters based on keys. This method fails silently.
keys (int[])
Explicit

IEnumerable.GetEnumerator

#
IEnumerator IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
An IEnumerator object that can be used to iterate through the collection.

Events

ParameterAdded

#
public event EventHandler<ParameterEventArgs> ParameterAdded
This event is raised when a parameter is added to this component.

ParameterDisplayChanged

#
public event EventHandler<ParameterEventArgs> ParameterDisplayChanged
This event is raised when a parameter is either shown or hidden.

ParameterEnabledChanged

#
public event EventHandler<ParameterEventArgs> ParameterEnabledChanged
This event is raised when a parameter is either enabled or disabled.

ParameterExpired

#
public event EventHandler<ParameterEventArgs> ParameterExpired
This event is raised when a parameter solution expires.

ParameterLayoutChanged

#
public event EventHandler<ParameterEventArgs> ParameterLayoutChanged
This event is raised when a parameter layout has been changed.

ParameterMaintenanceRequired

#
public event EventHandler<ParametersEventArgs> ParameterMaintenanceRequired
This event is raised whenever a significant change to the parameter topology has been made. For example when parameters get added, removed or deserialized. Making sure parameter access, nicknames, mutability, etc. are correctly set up is best done by handling this event.

ParameterRemoved

#
public event EventHandler<ParameterEventArgs> ParameterRemoved
This event is raised when a parameter is removed from this component.

ParameterRenamed

#
public event EventHandler<ParameterEventArgs> ParameterRenamed
This event is raised when a parameter user name changes.