/// <summary> /// Initialize new instance of <see cref="LiveQuestionAnswer"/> using specific question and answer. /// </summary> /// <param name="question"><see cref="LiveQuestion"/> instance.</param> /// <param name="answer">Answer text.</param> public LiveQuestionAnswer(LiveQuestion question, string answer) { if (question == null) { throw new ArgumentNullException("question"); } if (answer == null) { throw new ArgumentNullException("answer"); } Question = question; Answer = new LiveAnswer(question.Number) { Text = answer }; }
/// <summary> /// Initialize new instance of <see cref="LiveQuestionAnswer"/> using specific question and answer. /// </summary> /// <param name="question"><see cref="LiveQuestion"/> instance.</param> /// <param name="answer"><see cref="LiveAnswer"/> instance.</param> public LiveQuestionAnswer(LiveQuestion question, LiveAnswer answer) { if (question == null) { throw new ArgumentNullException("question"); } if (answer == null) { throw new ArgumentNullException("answer"); } if (question.Number != answer.Number) { throw new InvalidOperationException("Question number must be equals answer number."); } Question = question; Answer = answer; }