public QuestionViewModel Create(IModerator moderator, IQuestion question)
        {
            var answerViewModels = question.Answers
                                   .Select(text => CreateAnswerViewModel(text, moderator, question)).ToList();

            return(new QuestionViewModel(question.Text, answerViewModels));
        }
Example #2
0
        public void UpdateViewModel(QuestionViewModel questionViewModel, IModerator moderator, IQuestion question)
        {
            var answerViewModels = question.Answers
                                   .Select(text => CreateAnswerViewModel(text, moderator, question));

            questionViewModel.Text             = question.Text;
            questionViewModel.AnswerViewModels = answerViewModels;
        }
        public void NewQuestion(IQuestion question, IModerator moderator)
        {
            var questionViewModel = _questionViewModel.Value;

            _questionViewModelFactory.UpdateViewModel(questionViewModel, moderator, question);

            ViewModel.Child = questionViewModel;
        }
        public AnswerViewModel(string text, IQuestion question, IModerator moderator)
        {
            _question  = question;
            _moderator = moderator;
            Text       = text;

            AnswerCommand = new DelegateCommand(x => Answer(), x => CanExecuteAnswer());
        }
Example #5
0
        public AnswerViewModel(string answer, IQuestion question, IModerator moderator)
        {
            Answer     = answer;
            _question  = question;
            _moderator = moderator;

            TappedCommand = new Command(x => SendAnswer(), x => CanExecuteAnswer());
        }
        public void NewQuestion(IQuestion question, IModerator moderator)
        {
            var viewModel = _questionViewModelFactory.Create(moderator, question);

            var page = new QuestionPage {
                BindingContext = viewModel
            };

            _app.MainPage = page;
        }
        public void NewQuestion(IQuestion question, IModerator moderator)
        {
            WriteTitle("Translate: " + question.Text);

            var answers = question.Answers.ToList();

            for (int i = 0; i < answers.Count; i++)
            {
                var answer = answers[i];

                Console.WriteLine(i + "\t" + answer);
            }

            var selectedIndex = GetSelectedIndex(answers.Count);

            moderator.Answer(question, answers[selectedIndex]);
        }
Example #8
0
 private static AnswerViewModel CreateAnswerViewModel(string text, IModerator moderator, IQuestion question)
 {
     return(new AnswerViewModel(text, question, moderator));
 }
Example #9
0
 public PermissionService(IModerator moderator)
 {
     _moderator = moderator;
 }
Example #10
0
 public Aggregator(Configuration configuration, IModerator moderator)
 {
     _configuration = configuration;
     _moderator     = moderator;
 }
Example #11
0
 public ModeratorModule(IModerator moderator)
 {
     _moderator = moderator;
 }
Example #12
0
 public ModeratorEMail(IModerator myModerator)
 {
     this.myModerator = myModerator;
 }
 public ModeratorTelNumber(IModerator myModerator)
 {
     this.myModerator = myModerator;
 }
Example #14
0
 public ModeratorAdultContent(IModerator myModerator)
 {
     this.myModerator = myModerator;
 }