Esempio n. 1
0
        private void CreatFileMI_Click(object sender, EventArgs e)//Вызывается при нажатии кнопки создания файла
        {
            this.Controls.Remove(WorkPanel);
            opros = new Opros(new List <Question>());
            OprCreator oprCreator = new OprCreator(ref opros);

            WorkPanel = oprCreator.CreateCrPanel(false);
            this.Controls.Add(WorkPanel);
        }
Esempio n. 2
0
        private Button DelQuestion        = new Button();           //Кнопка удаления вопроса.

        public OprCreator(ref Opros opros)
        {
            this.opros   = opros;
            AnswCount    = 0;
            AnswersYPos  = -20;
            MiddleClmnX  = 340;
            RightClmnX   = 460;
            SelectedQsn  = 0;
            was_del      = false;
            OpenFromFile = false;
        }
Esempio n. 3
0
        private void openFileDialog1_FileOk(object sender, CancelEventArgs e)//Вызывается при нажатии кнопки открытия файла.
        {
            BinaryFormatter formatter = new BinaryFormatter();

            using (FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open))
                opros = (Opros)formatter.Deserialize(fs);
            FileName = openFileDialog1.FileName;

            this.Controls.Remove(WorkPanel);
            OprCreator oprCreator = new OprCreator(ref opros);

            WorkPanel = oprCreator.CreateCrPanel(true);
            this.Controls.Add(WorkPanel);
            FileCreated = true;
        }
Esempio n. 4
0
        private void openFileDialog2_FileOk(object sender, CancelEventArgs e)
        {
            //Достаём опрос из файла.
            BinaryFormatter formatter = new BinaryFormatter();

            using (FileStream fs = new FileStream(openFileDialog2.FileName, FileMode.Open))
                opros = (Opros)formatter.Deserialize(fs);
            FileName    = openFileDialog2.FileName;
            FileCreated = true;

            //Очищаем и заполняем рабочую панель.
            this.Controls.Remove(WorkPanel);
            WorkPanel = new Panel();
            this.MainMenuStrip.Visible = false;
            OprFill oprFill = new OprFill(ref opros, ref WorkPanel);

            oprFill.StartPanel();
            this.Controls.Add(WorkPanel);
        }
Esempio n. 5
0
        private int i;              //Индекс текущего вопроса.

        public OprFill(ref Opros opros, ref Panel StartPanel)
        {
            this.opros     = opros;
            this.WorkPanel = StartPanel;
            i = 0;
        }