Dynamo.Graph.Workspaces.WorkspaceModel.ReConnectOutputConnections C# (CSharp) Method

ReConnectOutputConnections() private method

Forms new connections from the external nodes to the Node To Code Node, based on the connectors passed as inputs.
private ReConnectOutputConnections ( string>.Dictionary externalOutputConnections, CodeBlockNodeModel cbn ) : List
externalOutputConnections string>.Dictionary List of connectors to remake, along with the port names of the new port
cbn Dynamo.Graph.Nodes.CodeBlockNodeModel The new Node To Code created Code Block Node
return List
        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;
        }
WorkspaceModel