示例#1
0
        public RemoveQuestion(QuestionViewModel question)
        {
            if (question == null)
                throw new ArgumentNullException("question");

            _question = question;
        }
示例#2
0
        private void NewQuestion()
        {
            NotifyIsDirty();

            var vm = new QuestionViewModel(
                new Domain.Question(), 
                _questionValidator,
                _answerValidator,
                _subjectValidator,
                _subjectQuery, 
                _busId
            );
            AddQuestion(vm);
            _view.MoveCurrentTo(vm);
        }
示例#3
0
        private void RemoveQuestion(QuestionViewModel question)
        {
            NotifyIsDirty();

            DettachEvents(question);
            _questions.Remove(question);

            RaiseQuestionRemoved(question.Question);
        }
示例#4
0
 private bool CanRemoveQuestion(QuestionViewModel question)
 {
     return (question != null && _questions.Contains(question));
 }
示例#5
0
 private void DettachEvents(QuestionViewModel question)
 {
     question.IsDirtyChangedEvent -= QuestionIsDirtyHandler;
     question.PropertyChanged -= QuestionChangedHandler;
 }
示例#6
0
        private void AddQuestion(QuestionViewModel question)
        {
            AttachEvents(question);
            this._questions.Add(question);

            RaiseQuestionAdded(question.Question);
        }