Class Pin
Represents a pin containing a value on a INode
public abstract class Pin : CorePropertyChanged, IPin
- Inheritance
-
objectCorePropertyChangedPin
- Implements
- Derived
Constructors
Pin(INode, string)
Creates a new instance of the Pin class on the provided node with the provided name
protected Pin(INode node, string name = "")
Parameters
Properties
ConnectedTo
Gets a read only list of pins this pin is connected to
public IReadOnlyList<IPin> ConnectedTo { get; }
Property Value
Direction
Gets the direction of the pin
public abstract PinDirection Direction { get; }
Property Value
IsEvaluated
Gets or sets a boolean indicating whether this pin is evaluated or not
public bool IsEvaluated { get; set; }
Property Value
IsNumeric
Gets a boolean indicating whether the type of this pin is numeric.
public bool IsNumeric { get; protected set; }
Property Value
Name
Gets or sets the name of the pin
public string Name { get; set; }
Property Value
Node
Gets the node the pin belongs to
public INode Node { get; }
Property Value
PinValue
Gets the value the pin holds
public abstract object? PinValue { get; }
Property Value
- object
Type
Gets the type of value the pin holds
public abstract Type Type { get; }
Property Value
Methods
ChangeType(Type, ref Type)
Changes the type of this pin, disconnecting any pins that are incompatible with the new type.
protected void ChangeType(Type type, ref Type currentType)
Parameters
typeTypeThe new type of the pin.
currentTypeTypeThe backing field of the current type of the pin.
ConnectTo(IPin)
Connects the pin to the provided pin
public void ConnectTo(IPin pin)
Parameters
pinIPinThe pin to connect this pin to
DisconnectAll()
Disconnects all pins this pin is connected to
public void DisconnectAll()
DisconnectFrom(IPin)
Disconnects the pin to the provided pin
public void DisconnectFrom(IPin pin)
Parameters
pinIPinThe pin to disconnect this pin to
IsTypeCompatible(Type, bool)
Determines whether this pin is compatible with the given type
public bool IsTypeCompatible(Type type, bool forgivingEnumMatching = true)
Parameters
typeTypeThe type to check for compatibility
forgivingEnumMatchingboolA boolean indicating whether or not enums should be exactly equal or just both be enums
Returns
Reset()
Resets the pin, causing it to re-evaluate the next time its value is requested
public void Reset()
Events
PinConnected
Occurs when the pin connects to another pin
public event EventHandler<SingleValueEventArgs<IPin>>? PinConnected
Event Type
PinDisconnected
Occurs when the pin disconnects from another pin
public event EventHandler<SingleValueEventArgs<IPin>>? PinDisconnected