Connections

References
[IoId("00000000-79ac-4cfd-be35-e0ac16d15c1e")] public sealed class Connections : IStorable
Provides access to a list of parameters as well as static methods for connecting and disconnecting parameters. The only way for external code to create or remove connections is via the static methods on this class.

Constructors

Connections

#
Create a new parameter collection.
public Connections()

Connections

#
public Connections(
reader
)

Properties

Backwards

#
Enumerate all guids in a backward fashion.
public IEnumerable<Guid> Backwards { get; }

Count

#
Gets the number of parameters in this list.
public int Count { get; }

Forwards

#
Enumerate all guids in a forward fashion.
public IEnumerable<Guid> Forwards { get; }

Indexers

this[]

#
Gets the parameter at the specific index.
public Guid this[
index
Index of parameter to retrieve.
] { get; }
Parameter at index.

Methods

Connect

#
Create a connection between a source and a target parameter.
public static bool Connect(
source,
target,
undo = null
)
True if connection was created.

Connect

#
Create a connection between a source and a target parameter.
public static bool Connect(
source,
target,
indexAtSource,
indexAtTarget,
undo = null
)
True if connection was created.

CopyAllInputs

#
Copy all incoming wires from one parameter to another.
public static int CopyAllInputs(
oldTarget,
newTarget,
undo = null
)
Number of wires successfully copied.

CopyAllOutputs

#
Copy all outgoing wires from one parameter to another.
public static int CopyAllOutputs(
oldSource,
newSource,
undo = null
)
Number of wires successfully copied.

CutOutMiddleMan

#
Attempt to cut out the middle man from a triplet of connected parameters.
public static bool CutOutMiddleMan(
left,
Source parameter.
middle,
Middleman.
right,
Target parameter.
undo = null
Undo actions.
)

Disconnect

#
Remove the connection between a source and a target parameter.
public static bool Disconnect(
source,
target,
undo = null
)
True if connection was removed.

DisconnectAllInputs

#
Remove all sources from a specific parameter.
public static int DisconnectAllInputs(
target,
undo = null
)
True if a change was made.

DisconnectAllInputsExcept

#
Remove all sources but one from a specific parameter.
public static int DisconnectAllInputsExcept(
target,
omit,
undo = null
)
True if a change was made.

DisconnectAllInputsExcept

#
Remove all unmarked sources from a specific parameter.
public static int DisconnectAllInputsExcept(
target,
omissions,
undo = null
)
True if a change was made.

DisconnectAllOutputs

#
Remove all targets from a specific parameter.
public static int DisconnectAllOutputs(
source,
undo = null
)
True if a change was made.

DisconnectAllOutputsExcept

#
Remove all targets but one from a specific parameter.
public static int DisconnectAllOutputsExcept(
source,
omit,
undo = null
)
True if a change was made.

DisconnectAllOutputsExcept

#
Remove all unmarked targets from a specific parameter.
public static int DisconnectAllOutputsExcept(
source,
omissions,
undo = null
)
True if a change was made.
Explicit

IStorable.Store

#
void IStorable.Store(
writer
)
Store

IndexOf

#
Find the index of a specific parameter within this list.
public int IndexOf(
parameter
Parameter to search for.
)
Index of parameter or -1 if the parameter was not found.

MigrateAllInputs

#
Migrate all incoming wires from one parameter to another.
public static int MigrateAllInputs(
oldTarget,
newTarget,
undo = null
)
Number of wires successfully migrated.

MigrateAllOutputs

#
Migrate all outgoing wires from one parameter to another.
public static int MigrateAllOutputs(
oldSource,
newSource,
undo = null
)
Number of wires successfully migrated.

Mimic

#
Duplicate another set of connections. This is a low level method which should only be used with utmost care. If at all possible consider the static methods on this class for creating, removing, and copying connections.
public int Mimic()

Mimic

#
Duplicate another set of connections. This is a low level method which should only be used with utmost care. If at all possible consider the static methods on this class for creating, removing, and copying connections.
public int Mimic(
Guid[]
other
)

Reorder

#
Sort the connections so that the ID order matches the given list.
public void Reorder(
Guid[]
order
)

ReplaceSource

#
Replace one source with another.
public static bool ReplaceSource(
oldSource,
Source to disconnect from.
newSource,
Source to connect to.
target,
Target to affect.
undo = null
Optional undo list.
)

ReplaceTarget

#
Replace one target with another.
public static bool ReplaceTarget(
source,
Source to affect.
oldTarget,
Target to disconnect.
newTarget,
Target to connect.
undo = null
Optional undo list.
)

SwapSources

#
Swap the sources of two parameters. I.e. cross the wires.
public static bool SwapSources(
sourceA,
sourceB,
targetA,
targetB,
undo = null
)
True if a swap was made.

ToArray

#
Create a duplicate of the Guid array.
public Guid[] ToArray()

Events

ParameterAdded

#
Raised whenever a parameter is added or inserted into this list.
public event EventHandler<ConnectionEventArgs> ParameterAdded

ParameterRemoved

#
Raised whenever a parameter is removed from this list.
public event EventHandler<ConnectionEventArgs> ParameterRemoved