mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-30 12:54:54 +00:00
The `RoutingPortCollection` type appears to not be currently serializable. If a class that contains this collection is going to be serialized, the collection should have the `JsonIgnore` attribute added. If the list is needed, use a conversion object and convert it to a regular list.
78 lines
2.7 KiB
C#
78 lines
2.7 KiB
C#
using Newtonsoft.Json;
|
|
using System;
|
|
|
|
|
|
namespace PepperDash.Essentials.Core
|
|
{
|
|
public class RoutingOutputPort : RoutingPort
|
|
{
|
|
/// <summary>
|
|
/// The IRoutingOutputs object this port lives on
|
|
/// </summary>
|
|
///
|
|
[JsonIgnore]
|
|
public IRoutingOutputs ParentDevice { get; private set; }
|
|
|
|
public InUseTracking InUseTracker { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
/// </summary>
|
|
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
|
|
/// May be string, number, whatever</param>
|
|
/// <param name="parent">The IRoutingOutputs object this port lives on</param>
|
|
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
|
|
object selector, IRoutingOutputs parent)
|
|
: this(key, type, connType, selector, parent, false)
|
|
{
|
|
}
|
|
|
|
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
|
|
object selector, IRoutingOutputs parent, bool isInternal)
|
|
: base(key, type, connType, selector, isInternal)
|
|
{
|
|
ParentDevice = parent ?? throw new ArgumentNullException(nameof(parent));
|
|
InUseTracker = new InUseTracking();
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{ParentDevice.Key}|{Key}|{Type}|{ConnectionType}";
|
|
}
|
|
}
|
|
|
|
/*public class RoutingOutputPort<TSelector> : RoutingPort<TSelector>
|
|
{
|
|
/// <summary>
|
|
/// The IRoutingOutputs object this port lives on
|
|
/// </summary>
|
|
public IRoutingOutputs ParentDevice { get; private set; }
|
|
|
|
public InUseTracking InUseTracker { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
/// </summary>
|
|
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
|
|
/// May be string, number, whatever</param>
|
|
/// <param name="parent">The IRoutingOutputs object this port lives on</param>
|
|
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
|
|
TSelector selector, IRoutingOutputs parent)
|
|
: this(key, type, connType, selector, parent, false)
|
|
{
|
|
}
|
|
|
|
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
|
|
TSelector selector, IRoutingOutputs parent, bool isInternal)
|
|
: base(key, type, connType, selector, isInternal)
|
|
{
|
|
ParentDevice = parent ?? throw new ArgumentNullException(nameof(parent));
|
|
InUseTracker = new InUseTracking();
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return ParentDevice.Key + ":" + Key;
|
|
}
|
|
}*/
|
|
} |