コード例 #1
0
ファイル: ControlForm.cs プロジェクト: dbrgn/pi-vote
        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();
        }