private void RenderSourceEventSelector(CordCircuit circuit, Rect SourceUnityEventRect)
        {
            if (circuit.SourceMonoBehaviourTypeName != null)
            {
                EventSelectionEditorModule <CordCircuit> SourceESEM
                    = RetrieveSourceESEM(circuit);

                EnsureSourceEventSelectionIsUpdated(circuit, SourceESEM);
                circuit.SourceUnityEventName
                    = RenderComplexSelectionAndGenerateNewSelectionName(
                          circuit,
                          SourceESEM,
                          circuit.SourceUnityEventName,
                          SourceEventLabelString,
                          SourceUnityEventRect
                          );
                //Debug.Log("SourceMonoBehaviourTypeName was not null");
            }
            else
            {
                string SourceEventName = circuit.SourceUnityEventName;
                circuit.SourceUnityEventName
                    = EditorGUI.TextField(
                          SourceUnityEventRect,
                          SourceEventLabel,
                          SourceEventName
                          );
                //Debug.Log("SourceMonoBehaviourTypeName was null");
            }
        }
        private EventSelectionEditorModule <CordCircuit> RetrieveSourceESEM(CordCircuit circuit)
        {
            if (!UIElementSourceESEMs
                .ContainsKey(circuit.SourceObjectRegistryKey))
            {
                int NewKey = circuit.SourceObjectRegistryKey;
                var NewSourceESEM
                    = new EventSelectionEditorModule <CordCircuit>();
                UIElementSourceESEMs.Add(NewKey, NewSourceESEM);
            }

            return(UIElementSourceESEMs[circuit.SourceObjectRegistryKey]);
        }
        EnsureSourceEventSelectionIsUpdated
            (CordCircuit circuit,
            EventSelectionEditorModule <CordCircuit> SourceESEM)
        {
            if (Switchboard.RegistryKeyType == typeof(UIElements) &&
                ((UIElements)circuit.SourceObjectRegistryKey)
                .ManagerClass() != null)
            {
                UIElements CircuitElement
                    = (UIElements)circuit.SourceObjectRegistryKey;

                circuit.SourceMonoBehaviourTypeName
                    = CircuitElement.ManagerClass().ToString();

                UpdateSourceSelectionModule(CircuitElement.ManagerClass(),
                                            SourceESEM);

                //Debug.Log("Updated SourceESEM using "
                //        + CircuitElement.ManagerClass().ToString());
            }
            else
            {
                string SourceMonoName = circuit.SourceMonoBehaviourTypeName;
                circuit.SourceMonoBehaviourTypeName
                    = EditorGUILayout.TextField(SourceMonoLabel, SourceMonoName);

                Type SourceMonoType = SourceMonoName == null
                                    ? null
                                    : Type.GetType(SourceMonoName);
                UpdateSourceSelectionModule(SourceMonoType, SourceESEM);

                //Debug.Log("Updated SourceESEM using "
                //        + SourceMonoName);
            }
            //SourceEventSelectionLabels = SourceESEM.SelectionNames;
        }