コード例 #1
0
        private void btnNewAnswer_Click(object sender, EventArgs e)
        {
            var answer = new AnswerEntity(_currentConfiguration);
            answer.Id = _currentConfiguration.GetNextAnswerId();
            var EditView = new AnswerView(answer);
            var dialogResult = EditView.ShowDialog();
            if (dialogResult == System.Windows.Forms.DialogResult.OK)
            {
                var slide = _currentConfiguration.SlideAssociated;
                var top = _currentConfiguration.TopLastQuestion;

                if (!_currentConfiguration.IsNew)
                {
                    int index;
                    var ansObj = PowerPointHelper.CreateTextboxOn(slide, 50, top, 600, 35,
                                                answer.TextToShow, 24,
                                                Microsoft.Office.Interop.PowerPoint.PpParagraphAlignment.ppAlignLeft, out index);
                    answer.AnswerTextBox = ansObj;
                    answer.AnswerTextBoxIndex = index;
                }

                _currentConfiguration.TopLastQuestion += 50;
                grdQuestions.DataSource = null;
                _currentConfiguration.Answers.Add(answer);
                grdQuestions.DataSource = _currentConfiguration.Answers;
            }
        }
コード例 #2
0
 private void EditAnswer()
 {
     var answer = grdQuestions.SelectedRows[0].DataBoundItem;
     var EditView = new AnswerView(answer as AnswerEntity);
     var dialogResult = EditView.ShowDialog();
     if (dialogResult == System.Windows.Forms.DialogResult.OK)
     {
         grdQuestions.DataSource = null;
         _currentConfiguration.UpdateAddinChanges();
         grdQuestions.DataSource = _currentConfiguration.Answers;
     }
 }