Пример #1
0
 private void OpenConfig_Click(object sender, RoutedEventArgs e)
 {
     if (File.Exists(configFilePath.Text))
     {
         ConfigWorker.ConfigFile config = ConfigWorker.ReadConfigFile(configFilePath.Text);
         structToControls(config);
     }
 }
Пример #2
0
 private void SaveConfig_Click(object sender, RoutedEventArgs e)
 {
     ConfigWorker.WriteConfigFile(controlsToStruct(), configFilePath.Text);
     ConfigurationSettings.AppSettings.Set(CONFIG_KEY, configFilePath.Text);
 }
Пример #3
0
 private void structToControls(ConfigWorker.ConfigFile config)
 {
     eMail.Text = config.Email;
     User.Text = config.User;
     Pass.Text = config.Password;
     Sender.Text = config.Sender;
     Server.Text = config.SmtpServer;
     Port.Text = config.SmtpPort;
     Delay.Text = config.Delay;
     ConnectionString.Text = config.ConnString;
 }