Esempio n. 1
0
 public static QuestionViewModel GetViewModelForQuestion(Question question)
 {
     Func<Question, QuestionViewModel> viewModelInstanceFactory = null;
     if (maps.TryGetValue(question.GetType(), out viewModelInstanceFactory))
     {
         return viewModelInstanceFactory(question);
     }
     else
     {
         throw new ArgumentOutOfRangeException("Could not locate a view model for question type");
     }
 }