Beispiel #1
0
        protected override void OnExecute(object parameter)
        {
            bool subQuestion = false;

            Question q = null;

            if (parameter != null)
            {
                subQuestion = true;
                q           = parameter as Question;
            }
            else
            {
                subQuestion = false;
                q           = ProjectMgr.Instance.SelectedQuestion;
            }

            if (q == null)
            {
                return;
            }

            QuestionEditWindow questionEditWindow = new QuestionEditWindow(q, subQuestion, false);

            if (questionEditWindow.ShowDialog().Value)
            {
                ProjectMgr.Instance.Changed = true;
            }
        }
Beispiel #2
0
        protected override void OnExecute(object parameter)
        {
            if (ProjectMgr.Instance.App == null)
            {
                return;
            }

            ObservableCollection <Question> subQuestionCollection = parameter as ObservableCollection <Question>;

            if (subQuestionCollection == null)
            {
                return;
            }

            SubQuestionTypeDialog subQuestionTypeDlg = new SubQuestionTypeDialog();

            if (subQuestionTypeDlg.ShowDialog().Value)
            {
                QuestionType       type               = subQuestionTypeDlg.SelectedQuestionType;
                Question           question           = ProjectMgr.Instance.CreateQuestion(type);
                QuestionEditWindow questionEditWindow = new QuestionEditWindow(question, true, false);
                if (questionEditWindow.ShowDialog().Value)
                {
                    subQuestionCollection.Add(question);
                    ProjectMgr.Instance.Changed = true;
                }
            }
        }
        protected override void OnExecute(object parameter)
        {
            if (ProjectMgr.Instance.App == null)
            {
                return;
            }

            QuestionType       type               = (QuestionType)Enum.Parse(typeof(QuestionType), parameter as string);
            Question           question           = ProjectMgr.Instance.CreateQuestion(type);
            QuestionEditWindow questionEditWindow = new QuestionEditWindow(question, false, false);

            if (questionEditWindow.ShowDialog().Value)
            {
            }
        }
        protected override void OnExecute(object parameter)
        {
            if (ProjectMgr.Instance.SelectedQuestion == null)
            {
                return;
            }

            Question newQuestion = ProjectMgr.Instance.SelectedQuestion.Clone() as Question;

            newQuestion.Id = Guid.NewGuid().ToString("N");
            QuestionEditWindow editWindow = new QuestionEditWindow(newQuestion, false, true);

            editWindow.ShowDialog();
            //ProjectMgr.Instance.App.Items.Add(newQuestion);
        }