protected void CleanseDependantCards(ReflexCard reflexCard, ProgrammingElement pendingCard) { ReflexData clip = reflex.Copy(); if (reflexCard.cardType == CardSpace.CardType.Sensor) { if (pendingCard != null) { clip.Sensor = pendingCard as Sensor; } else { clip.Sensor = null; } } if (reflexCard.cardType == CardSpace.CardType.Actuator) { // Kind of a hack here to deal with mixing Switch and Inline. If either // of these actuators are removed and replaced with the other then we need // to clear the Modifier list to prevent loops and self-referential inlines. if (pendingCard != null && reflexCard != null) { if ((pendingCard.upid == "actuator.inlinetask" && reflexCard.Card.upid == "actuator.switchtask") || (pendingCard.upid == "actuator.switchtask" && reflexCard.Card.upid == "actuator.inlinetask")) { clip.Modifiers.Clear(); } } if (pendingCard != null) { clip.Actuator = pendingCard as Actuator; } else { clip.Actuator = null; } } if (reflexCard.cardType == CardSpace.CardType.Selector) { if (pendingCard != null) { clip.Selector = pendingCard as Selector; } else { clip.Selector = null; } } reflex.Paste(clip); }