private static Wire CircuitAddEdge(Element fromNode, int fromPinIndex, Element toNode, int toPinIndex)
        {
            DomNode domNode = new DomNode(Schema.connectionType.Type);

            Wire connection = domNode.As <Wire>();

            connection.OutputElement = fromNode;
            connection.OutputPin     = fromNode.Type.GetOutputPin(fromPinIndex);
            connection.InputElement  = toNode;
            connection.InputPin      = toNode.Type.GetInputPin(toPinIndex);
            connection.SetPinTarget();
            connection.Cast <WireStyleProvider <Module, Connection, ICircuitPin> >().EdgeStyle = EdgeStyle.DirectCurve;

            return(connection);
        }