private CtpServerConfig SaveData() { var cfg = new CtpServerConfig(); cfg.Accounts = new List <CtpAccount>(lstAccounts.Items.Cast <CtpAccount>()); cfg.EnableSSL = chkEnableSSL.Checked; cfg.ServerCertificatePath = txtLocalCertPath.Text; cfg.CertificatePassword = txtLocalCertPassword.Text; cfg.UseEphemeralCertificates = chkUseEphemeralCertificates.Checked; return(cfg); }
private void LoadData(CtpServerConfig config) { lstAccounts.Items.Clear(); if (config.Accounts != null) { foreach (var account in config.Accounts) { lstAccounts.Items.Add(account); } } chkEnableSSL.Checked = config.EnableSSL; txtLocalCertPath.Text = config.ServerCertificatePath; txtLocalCertPassword.Text = config.CertificatePassword; chkUseEphemeralCertificates.Checked = config.UseEphemeralCertificates; }