Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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;
        }