protected List <InteractionComponent> ProtectedGet(InteractionComponentName componentName, List <InteractionComponent> componentList) { if (!IsValidComponent(this.interactionType.Value, componentName)) { return(null); } return(componentList); }
protected void CheckComponentSet(InteractionComponentName componentName, List <InteractionComponent> componentList) { if (componentList == null) { return; } if (!IsValidComponent(this.interactionType.Value, componentName)) { throw new ArgumentException(componentName.ToString().ToLower() + " is not a valid interaction component for the given interactionType", "componentName"); } }
public static bool IsValidComponent(InteractionTypeValue interactionType, InteractionComponentName componentName) { if (interactionType == InteractionTypeValue.Choice || interactionType == InteractionTypeValue.Sequencing) { return(componentName == InteractionComponentName.Choices); } else if (interactionType == InteractionTypeValue.Likert) { return(componentName == InteractionComponentName.Scale); } else if (interactionType == InteractionTypeValue.Matching) { return(componentName == InteractionComponentName.Source || componentName == InteractionComponentName.Target); } else if (interactionType == InteractionTypeValue.Performance) { return(componentName == InteractionComponentName.Steps); } return(false); }