Ejemplo n.º 1
0
        public void pictureBox3_Click(object sender, EventArgs e)  // add new slide
        {
            //                      |
            //                      |  Because number anyway will be updated in refresh() - so "mb delete"
            //                     \ /
            //                      v
            Slide slide = new Slide(0, string.Concat("Вопрос №", (slideItems.Count + 1).ToString()));

            test.slides.Add(slide);

            SlideItemUC slideItem = new SlideItemUC(this, slide.question);

            slideItems.Add(slideItem);

            flowLayoutPanel1.Controls.Add(slideItem);

            if (!test.slides.Count.Equals(1))
            {
                int newNumber = test.slides.Count - 1;

                foreach (Answer answer in test.slides[newNumber - 1].answers)
                {
                    if (answer.nextSlideNumber.Equals(-1))
                    {
                        answer.nextSlideNumber = newNumber;
                    }
                }
            }

            refresh();
        }
Ejemplo n.º 2
0
        private void loadSlides()
        {
            foreach (Slide slide in test.slides)
            {
                SlideItemUC slideItem = new SlideItemUC(this, slide.question);
                slideItems.Add(slideItem);

                flowLayoutPanel1.Controls.Add(slideItem);
            }
        }