public ExternalSignalEditorForm(ExternalSignal signal) { InitializeComponent(); initCategoryDropDown(); AddingNew = (signal == null); this.signal = (signal != null) ? signal : new ExternalSignal(); }
public AutoPathSearcher(ExternalSignal source, RouterOutput destination) { if (source == null) { throw new ArgumentNullException(nameof(source)); } if (destination == null) { throw new ArgumentNullException(nameof(destination)); } Source = source; Destination = destination; search(); }
public TallyBoolean(ExternalSignal signal, TallyColor color) : base(getName(signal, color), getColor(color), getDescription(signal, color)) { this.signal = signal; this.color = color; signal.IdChanged += idChangedHandler; signal.NameChanged += nameChangedHandler; switch (color) { case TallyColor.Red: CurrentState = signal.RedTally; signal.RedTallyChanged += tallyChangedHandler; break; case TallyColor.Green: CurrentState = signal.GreenTally; signal.GreenTallyChanged += tallyChangedHandler; break; } }
public RouterOutputAssignableExternalSignal(ExternalSignal signal) { this.signal = signal; }
private static string getDescription(ExternalSignal signal, TallyColor color) => string.Format("Signal [(#{0}) {1}] has {2} tally.", signal.ID, signal.Name, getColorString(color));
private static string getName(ExternalSignal signal, TallyColor color) => string.Format("signal.{0}.{1}tally", signal.ID, getColorString(color));
private void nameChangedHandler(ExternalSignal signal, string oldName, string newName) { Description = getDescription(signal, color); }
private void idChangedHandler(ExternalSignal signal, int oldValue, int newValue) { Name = getName(signal, color); Description = getDescription(signal, color); }