예제 #1
0
        private void ControlForm_Load(object sender, EventArgs e)
        {
            SetupForm setupForm = new SetupForm();

              if (setupForm.ShowDialog() != DialogResult.OK)
              {
            Close();
            return;
              }
              else
              {
            this.server = new KioskServer(setupForm.CertificateStorage, setupForm.ServerCertificate);
            this.server.Start();

            this.memberDatabase = setupForm.MemberDatabase;
              }
        }
예제 #2
0
파일: SetupForm.cs 프로젝트: dbrgn/pi-vote
        private void memberDatabaseBrowseButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();
              dialog.Title = "Pi-Vote Kiosk - Open member database";
              dialog.CheckFileExists = true;
              dialog.Filter = "Comma Seperated Values|*.csv";

              if (dialog.ShowDialog() == DialogResult.OK)
              {
            MemberDatabase = new MemberDatabase();
            MemberDatabase.ImportCsv(dialog.FileName);

            if (MemberDatabase.Entries.Count() < 1)
            {
              MemberDatabase = null;
            }
            else
            {
              this.memberDatabaseTextBox.Text = dialog.FileName;
            }
              }

              CheckValid();
        }
예제 #3
0
파일: SetupForm.cs 프로젝트: dbrgn/pi-vote
        private void SetupForm_Load(object sender, EventArgs e)
        {
            CenterToScreen();

              this.settings = new Properties.Settings();

              if (File.Exists(this.settings.CertificateStorageFileName))
              {
            this.certificateStorageTextBox.Text = this.settings.CertificateStorageFileName;
            CertificateStorage = Serializable.Load<CertificateStorage>(this.settings.CertificateStorageFileName);
              }

              if (File.Exists(this.settings.ServerCertificateFilename))
              {
            this.serverCertificateTextBox.Text = this.settings.ServerCertificateFilename;
            ServerCertificate = Serializable.Load<Certificate>(this.settings.ServerCertificateFilename).OnlyPublicPart;
              }

              if (File.Exists(this.settings.MemberDatabaseFilename))
              {
            this.memberDatabaseTextBox.Text = this.settings.MemberDatabaseFilename;

            MemberDatabase = new MemberDatabase();
            MemberDatabase.ImportCsv(this.settings.MemberDatabaseFilename);

            if (MemberDatabase.Entries.Count() < 1)
            {
              MemberDatabase = null;
            }
              }

              CheckValid();
        }