private void LoadEmailServerSettings() { EmailServerSettings = new EmailServerSettingsModel() { Server = (string)ApplicationSettings.Read("Server"), Username = (string)ApplicationSettings.Read("Username"), Password = (string)ApplicationSettings.Read("Password"), }; var enableSsl = ApplicationSettings.Read("EnableSsl"); if (enableSsl != null) EmailServerSettings.EnableSsl = Convert.ToBoolean(enableSsl); var port = ApplicationSettings.Read("Port"); if (port != null) EmailServerSettings.Port = Convert.ToInt32(port); EmailServerSettings.PropertyChanged += EmailServerSettings_PropertyChanged; }
private static EmailServerSettingsModel PrepareSettings() { var settings = new EmailServerSettingsModel() { Server = (string)ApplicationSettings.Read("Server"), Username = (string)ApplicationSettings.Read("Username"), Password = (string)ApplicationSettings.Read("Password"), }; var enableSsl = ApplicationSettings.Read("EnableSsl"); if (enableSsl != null) settings.EnableSsl = Convert.ToBoolean(enableSsl); var port = ApplicationSettings.Read("Port"); if (port != null) settings.Port = Convert.ToInt32(port); return settings; }