private List<ConnectorModel> ReConnectOutputConnections(Dictionary<ConnectorModel, string> externalOutputConnections, CodeBlockNodeModel cbn)
{
List<ConnectorModel> newConnectors = new List<ConnectorModel>();
foreach (var kvp in externalOutputConnections)
{
var connector = kvp.Key;
var variableName = kvp.Value;
//Get the start and end idex for the ports for the connection
var portModel = cbn.OutPorts.FirstOrDefault(
port => cbn.GetRawAstIdentifierForOutputIndex(port.Index).Value.Equals(variableName));
if (portModel == null)
continue;
//Make the new connection and then record and add it
var newConnector = ConnectorModel.Make(
cbn,
connector.End.Owner,
portModel.Index,
connector.End.Index);
newConnectors.Add(newConnector);
}
return newConnectors;
}