Exemplo 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);
        }
Exemplo 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;
        }
Exemplo 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;
        }
Exemplo 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);
        }
Exemplo n.º 5
0
        private int i;              //Индекс текущего вопроса.

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