コード例 #1
0
ファイル: RemoveQuestion.cs プロジェクト: LukeForder/TestIt
        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);
        }