public static ISchemeComponent GetDestination(SchemeView scheme, WireView wire) { var port = scheme.ExternalOutputs.FirstOrDefault(e => e.WireEndConnects(wire)); var gate = scheme.Gates.FirstOrDefault(g => g.WireEndConnects(wire)); // only one could be retrieved Debug.Assert(port == null ^ gate == null); Debug.Assert(port != null ^ gate != null); return(gate == null ? port : gate); }
public WireDto(WireView view) => Connection = view.Connection;